:root {
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-2: #edf3eb;
  --text: #152018;
  --muted: #647066;
  --line: #d9e3d8;
  --primary: #1f7a4d;
  --primary-dark: #165b39;
  --warning: #e8a319;
  --danger: #c84c3c;
  --success: #16a34a;
  --success-dark: #15803d;
  --blue: #2878bd;
  --focus: 0 0 0 4px rgba(31, 122, 77, .15);
  --shadow: 0 12px 34px rgba(23, 32, 24, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(232, 163, 25, .07), transparent 30%),
    linear-gradient(180deg, #f8faf7 0%, var(--bg) 42%);
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow);
  font-weight: 800;
  transform: translateY(-150%);
}
.skip-link:focus {
  transform: translateY(0);
}

.login-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2.5vh, 36px) clamp(16px, 3vw, 36px);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 12% 18%, rgba(22, 163, 74, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(21, 128, 61, 0.4) 0%, transparent 45%),
    linear-gradient(135deg, #072715 0%, #0e3b24 45%, #144e31 100%);
}

@media (max-height: 600px) or (max-width: 900px) {
  .login-page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
  }
}

/* Background floating glow orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.6;
}
.orb-1 {
  width: 420px;
  height: 420px;
  background: rgba(34, 197, 94, 0.25);
  top: -100px;
  left: -100px;
}
.orb-2 {
  width: 500px;
  height: 500px;
  background: rgba(234, 179, 8, 0.15);
  bottom: -120px;
  right: -120px;
}

.login-stage {
  width: min(1140px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: rgba(12, 38, 22, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 2;
}

.login-stage.auth-compact {
  width: min(520px, 100%);
  min-height: auto;
  grid-template-columns: 1fr;
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 32px);
  padding: clamp(28px, 3.5vw, 44px);
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.15), transparent 40%),
    linear-gradient(160deg, rgba(16, 51, 30, 0.85) 0%, rgba(9, 33, 19, 0.95) 100%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.login-brand-mark {
  width: 54px;
  height: 54px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffffff;
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.login-brand strong {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #ffffff;
  line-height: 1.25;
}

.login-brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 500;
}

.login-copy {
  max-width: 640px;
  position: relative;
  z-index: 1;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(244, 197, 77, 0.18);
  border: 1px solid rgba(244, 197, 77, 0.35);
  color: #f4c54d;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.login-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.login-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(13.5px, 1.2vw, 15px);
  line-height: 1.65;
}

.login-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-insights article {
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.login-insights article:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(244, 197, 77, 0.4);
}

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.insight-num {
  font-size: 11px;
  font-weight: 800;
  color: #f4c54d;
  background: rgba(244, 197, 77, 0.18);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(244, 197, 77, 0.3);
}

.insight-icon {
  font-size: 16px;
}

.login-insights strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.login-insights small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  line-height: 1.38;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(24px, 3.5vw, 40px);
  background: #ffffff;
  position: relative;
}

.login-panel-head h2 {
  margin: 10px 0 6px;
  font-size: 26px;
  font-weight: 800;
  color: #152018;
  letter-spacing: -0.3px;
}

.login-panel-head p {
  margin: 0;
  color: #647066;
  font-size: 13.5px;
}

.security-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: #edf7f0;
  color: #15803d;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #d1e7d6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form > label:not(.remember-option) {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #2c3e2e;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-left-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: #8ca28e;
  fill: none;
  stroke-width: 2;
  pointer-events: none;
  transition: stroke 0.2s ease;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 42px;
  border: 1.5px solid #d1ded0;
  border-radius: 10px;
  background: #f8faf7;
  color: #152018;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Chrome autofill background fix */
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #f4faf4 inset !important;
  -webkit-text-fill-color: #152018 !important;
  border-color: #16a34a !important;
}

.login-form input:focus {
  outline: 0;
  border-color: #16a34a;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.login-form input:focus + .input-left-icon,
.input-icon-wrap:focus-within .input-left-icon {
  stroke: #16a34a;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8ca28e;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.password-toggle:hover {
  background: #edf5ee;
  color: #15803d;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.login-form label.remember-option {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #4a5c4d;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.remember-option input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1.5px solid #c2dec7 !important;
  border-radius: 4px;
  background: #ffffff !important;
  accent-color: #16a34a;
  cursor: pointer;
  flex-shrink: 0;
}

.forgot-link {
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.16s ease;
}

.forgot-link:hover {
  color: #166534;
  text-decoration: underline;
}

.login-button {
  min-height: 50px;
  width: 100%;
  margin-top: 6px;
  padding: 12px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border: 1px solid #15803d;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.28);
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-button:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.38);
}

.login-button:active {
  transform: translateY(0);
}

.login-footer-note {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #edf3eb;
  text-align: center;
  font-size: 12px;
  color: #728a74;
  font-weight: 600;
}
.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  background: var(--surface-2);
  color: var(--primary-dark);
  outline: 0;
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none;
}
.login-button {
  min-height: 50px;
  width: 100%;
  margin-top: 4px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(31, 122, 77, .22);
}
.login-button:hover {
  transform: translateY(-1px);
}
.form-panel, .panel, .stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.form-panel { padding: 32px; display: grid; gap: 18px; }
.form-note { color: var(--muted); font-size: 13px; margin: 0; }
.farm-thumb {
  width: 74px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.farm-image-link {
  display: grid;
  gap: 5px;
  width: fit-content;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.farm-image-link:hover .farm-thumb {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 122, 77, .12);
}
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 20, 10, .78);
}
.image-viewer-panel {
  position: relative;
  width: min(920px, 100%);
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}
.image-viewer-panel img {
  width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  object-fit: contain;
  background: #111;
}
.image-viewer-panel strong {
  color: var(--text);
}
.image-viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.image-viewer-nav {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 54px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--text);
  cursor: pointer;
  font-size: 38px;
  line-height: 1;
  transform: translateY(-50%);
}
.image-viewer-nav:hover { background: #fff; }
.image-viewer-nav.previous { left: 20px; }
.image-viewer-nav.next { right: 20px; }
.farm-photo-preview {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.farm-photo-preview img {
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}
.farm-photo-gallery { display: grid; gap: 10px; }
.farm-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.farm-photo-preview span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.farm-photo-preview input { width: auto; }
.farm-gallery-thumbs {
  display: flex;
  width: max-content;
  max-width: 250px;
  gap: 5px;
  overflow-x: auto;
  padding: 3px;
}
.farm-gallery-thumbs .farm-thumb { width: 58px; height: 46px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 295px 1fr; }
.print-brand { display: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(23, 53, 31, .98), rgba(13, 42, 24, .98)),
    radial-gradient(circle at top left, rgba(244, 197, 77, .18), transparent 34%);
  color: #fff;
  box-shadow: 16px 0 40px rgba(23, 32, 24, .08);
}
.brand {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  padding: 8px 6px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.brand strong {
  display: block;
  line-height: 1.2;
}
.brand small { display: block; color: #b9cbb9; margin-top: 4px; }
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 8px 0 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  transition: background .16s ease, border-color .16s ease;
}
.sidebar-profile:hover,
.sidebar-profile:focus-visible {
  border-color: rgba(244, 197, 77, .32);
  background: rgba(255, 255, 255, .13);
}
.sidebar-profile > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #17351f;
  background: #f4c54d;
  font-weight: 900;
}
.sidebar-profile > span img,
.user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
/* Account Settings Hero Banner & Avatar Cards */
.settings-profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #14492d 0%, #1c5e3b 100%);
  border-radius: 16px;
  color: #ffffff;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(20, 73, 45, 0.25);
  position: relative;
  overflow: hidden;
}

.settings-avatar-wrap {
  position: relative;
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
}

.settings-avatar-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: #f4c54d;
  color: #14492d;
  font-size: 36px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-hero-meta {
  flex: 1;
  min-width: 0;
}

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.hero-name-row h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.role-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(244, 197, 77, 0.25);
  color: #f4c54d;
  border: 1px solid rgba(244, 197, 77, 0.4);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.settings-hero-meta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.settings-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  background: #f4c54d;
  color: #14492d;
  font-size: 40px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #e2ece1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 0;
}

.settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.settings-form .button {
  margin-top: 10px;
  align-self: flex-start;
}
.profile-avatar-small {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  margin: 0;
  font-size: 28px;
}
.my-profile-identity h3 { margin: 0 0 5px; font-size: 22px; }
.my-profile-identity p { margin: 0; color: var(--muted); }
.profile-record-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.sidebar-profile strong,
.sidebar-profile small {
  display: block;
}
.sidebar-profile strong {
  max-width: 170px;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-profile small {
  margin-top: 3px;
  color: #b9cbb9;
  font-size: 11px;
}
.nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 5px;
  align-content: start;
  grid-auto-rows: min-content;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.nav::-webkit-scrollbar {
  width: 6px;
}
.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
}
.nav-section {
  margin: 32px 10px 10px;
  padding-top: 8px;
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-section:first-of-type {
  margin-top: 8px;
  padding-top: 0;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 9px 11px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #e9f2e7;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.nav a:hover {
  transform: translateX(2px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.10);
}
.nav a.active {
  background: #f7faf4;
  color: #17351f;
  border-color: rgba(244, 197, 77, .5);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .16);
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: #f4c54d;
}
.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #f4c54d;
  font-size: 11px;
  font-weight: 900;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav a.active .nav-icon {
  background: #17351f;
  color: #fff;
}
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 16px 10px 4px;
  color: #b9cbb9;
}
.sidebar-footer small,
.sidebar-footer strong {
  display: block;
}
.sidebar-footer strong {
  margin-top: 3px;
  color: #fff;
  font-size: 13px;
}

.sidebar {
  padding: 16px 14px;
  background:
    linear-gradient(180deg, #123c24 0%, #0f321e 48%, #092414 100%),
    radial-gradient(circle at 12% 0%, rgba(244, 197, 77, .18), transparent 28%);
  border-right: 1px solid rgba(255, 255, 255, .08);
}
.brand {
  gap: 11px;
  min-height: 76px;
  padding: 10px 8px 16px;
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.brand-mark {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, .75);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}
.brand strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: 0;
}
.brand small {
  color: rgba(229, 241, 226, .76);
  font-size: 12px;
}
.nav {
  gap: 4px;
  padding: 4px 4px 10px 0;
}
.nav::-webkit-scrollbar {
  width: 4px;
}
.nav::-webkit-scrollbar-track {
  background: transparent;
}
.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}
.nav-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 32px 8px 12px;
  padding-top: 8px;
  color: rgba(222, 236, 218, .65);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .08em;
}
.nav-section:first-of-type {
  margin-top: 8px;
  padding-top: 0;
}
.nav-section::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, .08);
}
.nav a {
  min-height: 46px;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: rgba(244, 249, 241, .88);
  isolation: isolate;
}
.nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  opacity: 0;
  transition: opacity .16s ease;
}
.nav a:hover,
.nav a:focus-visible {
  transform: translateX(2px);
  color: #fff;
  border-color: rgba(255, 255, 255, .11);
  background: transparent;
}
.nav a:hover::after,
.nav a:focus-visible::after {
  opacity: 1;
}
.nav a.active {
  color: #102c1b;
  background: linear-gradient(135deg, #fffdf0 0%, #f3f8ed 100%);
  border-color: rgba(244, 197, 77, .7);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .72);
}
.nav a.active::before {
  left: -6px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: #f4c54d;
  box-shadow: 0 0 0 3px rgba(244, 197, 77, .13);
}
.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .10);
  color: #f4c54d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.nav-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}
.nav a:hover .nav-icon,
.nav a:focus-visible .nav-icon {
  background: rgba(244, 197, 77, .16);
  color: #ffd76a;
}
.nav a.active .nav-icon {
  background: #123c24;
  color: #f4c54d;
  box-shadow: 0 8px 18px rgba(18, 60, 36, .22);
}
.nav-label {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.15px;
  line-height: 1.25;
}
.sidebar-footer {
  margin-top: 12px;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: rgba(229, 241, 226, .68);
}
.sidebar-footer strong {
  color: #fff;
  font-size: 12px;
}
.sidebar-backdrop,
.mobile-nav-toggle {
  display: none;
}
.main {
  width: 100%;
  min-width: 0;
  max-width: 1880px;
  margin: 0 auto;
  padding: 28px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}
.topbar-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.15;
}
.eyebrow { margin: 0; color: var(--primary); font-weight: 700; letter-spacing: 0; text-transform: uppercase; font-size: 12px; }
.user-dropdown {
  position: relative;
  z-index: 50;
}
.user-dropdown summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border: 1px solid #d4e3d3;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf5 100%);
  cursor: pointer;
  list-style: none;
  box-shadow: 0 2px 8px rgba(23, 53, 31, .04);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
.user-dropdown summary:hover {
  border-color: #a8caa6;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(23, 53, 31, .09);
  transform: translateY(-1px);
}
.user-dropdown summary::-webkit-details-marker {
  display: none;
}
.user-dropdown[open] summary {
  border-color: rgba(31, 122, 77, .5);
  box-shadow: 0 8px 22px rgba(23, 53, 31, .12);
  background: #ffffff;
}
.user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  color: #14492d;
  background: #f4c54d;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8), 0 4px 10px rgba(0, 0, 0, .1);
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.user-avatar.avatar-large {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.user-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.user-summary-name {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}
.user-summary-role {
  display: inline-block;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf4eb;
  color: #14492d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
}
.dropdown-caret {
  width: 7px;
  height: 7px;
  margin: 0 2px 0 4px;
  border-right: 2px solid #5d7562;
  border-bottom: 2px solid #5d7562;
  transform: rotate(45deg) translateY(-1px);
  transition: transform .16s ease;
}
.user-dropdown[open] .dropdown-caret {
  transform: rotate(225deg) translateY(1px);
}
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d4e3d3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(18, 40, 26, .18);
  animation: dropdown-pop .18s cubic-bezier(.16, 1, .3, 1);
}
@keyframes dropdown-pop {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14492d 0%, #1c623e 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(20, 40, 25, 0.14);
}
.dropdown-profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dropdown-profile-info strong {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-profile-info small {
  color: rgba(234, 246, 236, .8);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-role-chip {
  display: inline-block;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(244, 197, 77, .25);
  border: 1px solid rgba(244, 197, 77, .4);
  color: #ffd76a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
}
.dropdown-nav-group,
.dropdown-footer {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dropdown-footer {
  padding-top: 4px;
  border-top: 1px solid #eef4ed;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #1d2c20;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.dropdown-item:hover,
.dropdown-item:focus-visible {
  background: #f4f8f3;
  color: #14492d;
  transform: translateX(2px);
}
.dropdown-item-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 8px;
  transition: background .15s ease;
}
.dropdown-item-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dropdown-item-icon.icon-dash { background: #eaf6eb; color: #15803d; }
.dropdown-item-icon.icon-set { background: #eff6ff; color: #2563eb; }
.dropdown-item-icon.icon-users { background: #f5f3ff; color: #7c3aed; }
.dropdown-item-icon.icon-log { background: #fef2f2; color: #dc2626; }

.dropdown-item.logout-link {
  color: #dc2626;
}
.dropdown-item.logout-link:hover {
  background: #fef2f2;
}
.stats-grid, .chart-grid {
  display: grid;
  gap: 18px;
}
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card { padding: 22px; }
.stat-card span { color: var(--muted); display: block; margin-bottom: 8px; }
.stat-card strong { font-size: 34px; }
.panel {
  padding: 22px;
  margin-bottom: 18px;
  border-color: rgba(23, 53, 31, .11);
}
.panel h2 { margin: 0 0 18px; font-size: 20px; }
.panel canvas {
  display: block;
  max-width: 100%;
}
.record-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(16, 43, 26, .28);
  animation: dialog-enter .18s ease-out;
}
.record-dialog-wide { width: min(1040px, calc(100% - 32px)); }
.record-dialog-sm { width: min(540px, calc(100% - 32px)); border-radius: 12px; }
.record-dialog-body {
  padding: 22px 24px;
}
.record-dialog-body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
}
.record-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px 22px 24px;
}
.record-dialog::backdrop {
  background: rgba(15, 31, 20, .58);
  backdrop-filter: blur(2px);
}
.record-dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
}
.record-dialog-header h2 { margin: 4px 0 0; font-size: 22px; }
.dialog-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.dialog-close:hover,
.dialog-close:focus-visible {
  background: #e3ece1;
  color: var(--primary-dark);
  transform: rotate(3deg);
}
.dialog-form {
  padding: 22px 24px 24px;
  align-items: start;
}
.dialog-note { margin: 18px 24px 0; }
.dialog-actions {
  justify-content: flex-end;
  padding-top: 6px;
}
.button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(23, 53, 31, .96), rgba(31, 122, 77, .86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='360' viewBox='0 0 900 360'%3E%3Crect width='900' height='360' fill='%2317351f'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='2'%3E%3Cpath d='M0 265c96-39 211-58 345-58 196 0 350 58 555 85'/%3E%3Cpath d='M0 314c126-42 247-55 363-39 176 25 342 75 537 77'/%3E%3Cpath d='M83 0v360M213 0v360M343 0v360M473 0v360M603 0v360M733 0v360'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
}
.dashboard-hero h2 {
  max-width: 780px;
  margin: 6px 0 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
}
.dashboard-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.55;
}
.dashboard-hero .eyebrow {
  color: #f4c54d;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
  min-width: 340px;
}
.hero-metrics a {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.hero-metrics a:hover,
.hero-metrics a:focus-visible {
  background: rgba(255, 255, 255, .17);
  border-color: rgba(255, 255, 255, .34);
  transform: translateY(-1px);
}
.hero-metrics span,
.hero-metrics small {
  display: block;
}
.hero-metrics span {
  font-size: 26px;
  font-weight: 800;
}
.hero-metrics small {
  margin-top: 5px;
  color: rgba(255, 255, 255, .72);
}
.dashboard-stats {
  margin-bottom: 18px;
}
.dashboard-stats.six-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 1300px) {
  .dashboard-stats.six-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .dashboard-stats.six-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .dashboard-stats.six-cards {
    grid-template-columns: 1fr;
  }
}

.dashboard-hero-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.dashboard-quick-actions .button {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 13px;
}

.rank-badge {
  font-size: 13px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f4f8f3;
  color: #16573f;
  min-width: 48px;
  text-align: center;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-success { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.dot-warning { background: #d97706; box-shadow: 0 0 0 3px #fef3c7; }
.dot-danger { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }

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

/* Top Performing Areas Leaderboard Component */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e3ede2;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fbf8 100%);
  box-shadow: 0 4px 14px rgba(20, 40, 25, 0.03);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.leader-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 40, 25, 0.08);
  border-color: rgba(31, 122, 77, 0.3);
}
.leader-rank-col {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.leader-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.leader-info strong {
  font-size: 14px;
  font-weight: 800;
  color: #172318;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-bar-wrap {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e9f2e7;
  overflow: hidden;
}
.leader-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #15803d, #22c55e);
  transition: width 0.4s ease;
}

.leader-row.rank-1 .leader-bar-fill { background: linear-gradient(90deg, #d97706, #f59e0b); }
.leader-row.rank-2 .leader-bar-fill { background: linear-gradient(90deg, #475569, #94a3b8); }
.leader-row.rank-3 .leader-bar-fill { background: linear-gradient(90deg, #c2410c, #ea580c); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.rank-badge.rank-1 {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  color: #92400e;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}
.rank-badge.rank-2 {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.12);
}
.rank-badge.rank-3 {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
  color: #9a3412;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}
.rank-badge.rank-other {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.leader-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.leader-metric strong {
  font-size: 15px;
  font-weight: 800;
  color: #172318;
  line-height: 1.1;
}
.leader-metric small {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.metric-card {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 128px;
  border-color: rgba(31, 122, 77, .12);
  box-shadow: 0 16px 36px rgba(23, 32, 24, .08);
  color: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.metric-card:hover,
.metric-card:focus-visible {
  border-color: rgba(31, 122, 77, .28);
  box-shadow: 0 18px 42px rgba(23, 32, 24, .12);
  transform: translateY(-2px);
}
.metric-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #17351f;
  background: linear-gradient(135deg, #f4c54d, #dfe7dc);
}
.metric-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.metric-card span:not(.metric-icon) {
  margin: 0;
  color: var(--muted);
}
.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.metric-unit {
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  margin-left: 2px;
  display: inline-block;
}
.dashboard-stats.six-cards .metric-card {
  padding: 14px 12px;
  gap: 10px;
}
.dashboard-stats.six-cards .metric-card strong {
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.4px;
}
.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: 18px;
  align-items: start;
}
.chart-panel-wide {
  grid-column: span 1;
}
.chart-panel,
.activity-panel,
.leaderboard-panel {
  margin-bottom: 0;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.panel-heading h2 {
  margin: 3px 0 0;
}
.chart-box {
  position: relative;
  width: 100%;
  height: 320px;
  min-height: 0;
  overflow: hidden;
}
.compact-chart {
  height: 250px;
}
.chart-box canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.chart-box canvas[hidden] {
  display: none !important;
}
.chart-empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.chart-empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  fill: none;
  stroke: #9aaa9b;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.chart-empty-state strong {
  color: var(--text);
  font-size: 15px;
}
.chart-empty-state span {
  font-size: 12px;
}

/* Tenant & Owner Percentile Breakdown */
.tenancy-percentile-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 122, 77, 0.12);
}
.tenancy-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 12px;
}
.tenancy-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}
.tenancy-bar-segment.owner {
  background: #1f7a4d;
}
.tenancy-bar-segment.tenant {
  background: #e8a319;
}
.tenancy-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tenancy-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8faf7;
  border: 1px solid rgba(31, 122, 77, 0.12);
  font-size: 13px;
  flex: 1;
}
.tenancy-stat-pill.owner {
  border-left: 4px solid #1f7a4d;
}
.tenancy-stat-pill.tenant {
  border-left: 4px solid #e8a319;
}
.tenancy-stat-pill strong {
  font-size: 14px;
  color: #17351f;
}
.tenancy-stat-pill .percent-badge {
  font-weight: 800;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: auto;
}
.tenancy-stat-pill.owner .percent-badge {
  background: rgba(31, 122, 77, 0.14);
  color: #1f7a4d;
}
.tenancy-stat-pill.tenant .percent-badge {
  background: rgba(232, 163, 25, 0.18);
  color: #b45309;
}
.activity-list {
  display: grid;
  gap: 12px;
}
.activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(31, 122, 77, .12);
}
.activity-item strong,
.activity-item small {
  display: block;
}
.activity-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}
.activity-item em {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}
.leaderboard {
  display: grid;
  gap: 10px;
}
.leader-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f7faf4, #fff);
  border: 1px solid var(--line);
}
.leader-row span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17351f;
  color: #fff;
  font-weight: 800;
}
.leader-row em {
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 800;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.form-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover, select:hover, textarea:hover {
  border-color: #bdcdbb;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--focus);
}
input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
  background: #f1f3f0;
  color: #7b837c;
}
.farmer-select-search {
  padding-left: 38px;
  background-color: #fbfdfb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667266' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
textarea { resize: vertical; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.form-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}
.form-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.rsbsa-form {
  align-items: stretch;
}
.rsbsa-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.rsbsa-groups > div {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.rsbsa-groups strong {
  font-size: 13px;
}
.checkbox-list {
  display: grid;
  gap: 8px;
}
.checkbox-list label,
.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--text);
  font-weight: 700;
}
.checkbox-list input,
.check-inline input {
  width: auto;
}
.profile-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.profile-summary article,
.detail-grid > div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}
.profile-summary span,
.detail-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.profile-summary strong,
.detail-grid strong {
  display: block;
  min-height: 20px;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.farmer-table-photo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d7e2d5;
  border-radius: 10px;
  background: #eef6ec;
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 900;
}
.farmer-table-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.farmer-picture-preview {
  min-height: 74px;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.farmer-picture-preview img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

/* Required Documents & Images UI */
.doc-upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.farmer-docs-inspection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.doc-card-view {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--heading);
}
.doc-card-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(31, 122, 77, 0.15);
}
.doc-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.doc-card-thumb:hover img {
  transform: scale(1.04);
}
.doc-card-thumb span {
  position: absolute;
  inset: 0;
  background: rgba(23, 53, 31, 0.65);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.doc-card-thumb:hover span {
  opacity: 1;
}
.doc-card-empty {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8faf7;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

/* Quick Batch Multi-Subsidy Grant Modal UI */
.batch-subsidy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.batch-category-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.batch-category-card h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--heading);
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.batch-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-checkbox-label {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.batch-checkbox-label:hover {
  background: #f0f7f2;
  border-color: var(--primary);
}
.batch-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}
.batch-checkbox-label .checkbox-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.profile-commodities {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.profile-farm-showcase {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #d7e2d5;
  border-radius: 8px;
  background: #f8fbf6;
}
.profile-commodities-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.profile-commodities-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}
.profile-farm-feature-grid {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(260px, 1.05fr);
  gap: 16px;
  align-items: stretch;
}
.profile-farm-feature {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 122, 77, .18);
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf4e8, #fff);
  color: var(--primary-dark);
  text-decoration: none;
  box-shadow: 0 18px 36px rgba(23, 32, 24, .12);
}
.profile-farm-feature img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: block;
  object-fit: cover;
  transition: transform .22s ease;
}
.profile-farm-feature:hover img,
.profile-farm-feature:focus-visible img {
  transform: scale(1.025);
}
.profile-farm-feature > span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(12, 36, 22, .88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.profile-farm-empty-visual {
  width: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}
.profile-farm-feature-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.profile-farm-feature-copy h4 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.08;
}
.profile-farm-feature-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.profile-farm-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.profile-farm-thumb {
  min-height: 118px;
  overflow: hidden;
  display: grid;
  align-content: end;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}
.profile-farm-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-farm-thumb span {
  margin: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.profile-farm-thumb strong {
  position: relative;
  z-index: 1;
  padding: 26px 10px 9px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .68));
  color: #fff;
  font-size: 13px;
}
.profile-farm-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px dashed #c5d6c1;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}
.profile-farm-empty strong {
  color: var(--text);
  font-size: 18px;
}
.profile-farm-empty span {
  color: var(--muted);
}
.profile-coverage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.profile-coverage-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #d7e2d5;
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.commodity-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.commodity-chip-card {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #d7e2d5;
  border-radius: 8px;
  background: #fbfdfb;
}
.commodity-chip-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.commodity-chip-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.commodity-chip-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.mini-empty {
  padding: 14px;
}
.progress-meter {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warning), var(--primary));
}
.actions { display: flex; gap: 10px; align-items: end; }
.button {
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 122, 77, .16);
}
.button.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(31, 122, 77, .22);
  transform: translateY(-1px);
}
.button.ghost {
  border-color: transparent;
  background: var(--surface-2);
  color: var(--primary-dark);
}
.button.ghost:hover {
  border-color: #cbdac8;
  background: #e4eee1;
}
.button.danger { background: #fff0ee; color: var(--danger); }
.button.success {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success-dark);
  box-shadow: 0 4px 12px rgba(22, 163, 74, .2);
}
.button.success:hover {
  background: var(--success-dark);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(21, 128, 61, .28);
  transform: translateY(-1px);
}
.button:active { transform: translateY(0); }
.button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.action-column { width: 172px; text-align: center; }
.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.table-actions form { margin: 0; }
.icon-button {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-button.edit { color: var(--primary); }
.icon-button.edit:hover { background: #edf8ef; border-color: #b9d9c2; }
.icon-button.view { color: #2878bd; }
.icon-button.view:hover { background: #edf6fd; border-color: #b8d5ec; }
.icon-button.delete { color: var(--danger); }
.icon-button.delete:hover { background: #fff0ee; border-color: #efc5bf; }
.icon-button.toggle { color: #8a6810; }
.icon-button.toggle:hover { background: #fff8df; border-color: #e6d18f; }
.icon-button:hover { transform: translateY(-1px); }
.icon-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity .15s ease, transform .15s ease;
}
.icon-button:hover::after, .icon-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.farm-details-content,
.crop-details-content,
.livestock-details-content,
.fishery-details-content,
.assistance-details-content { display: grid; gap: 20px; padding: 22px 24px 24px; }
.record-view-dialog { width: min(760px, calc(100% - 32px)); }
.record-view-content { display: grid; gap: 20px; padding: 22px 24px 24px; }
.farmer-profile-dialog { width: min(1180px, calc(100% - 32px)); }
.admin-profile-view { gap: 18px; }
.admin-profile-view .profile-farm-feature {
  min-height: 300px;
}
.admin-profile-view .profile-farm-feature img {
  min-height: 300px;
}
.record-view-image {
  width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface-2);
}
.crop-detail-hero,
.farm-detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.25fr);
  gap: 20px;
  align-items: stretch;
}
.farm-detail-feature,
.crop-detail-feature {
  position: relative;
  min-height: 220px;
  height: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 122, 77, .18);
  border-radius: 12px;
  background: linear-gradient(135deg, #eef5ec, #fbfdfb);
  box-shadow: 0 14px 30px rgba(23, 32, 24, .08);
}
.farm-detail-feature img,
.crop-detail-feature img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: block;
  object-fit: cover;
  transition: transform .22s ease;
}
.farm-detail-feature:hover img,
.farm-detail-feature:focus-visible img,
.crop-detail-feature:hover img,
.crop-detail-feature:focus-visible img {
  transform: scale(1.025);
}
.farm-detail-feature > span,
.crop-detail-feature > span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 36, 22, .86);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}
/* Sector Themes for Detail Modals */
.theme-farms { --sector-color: #166534; --sector-bg: #f0fdf4; --sector-border: #bbf7d0; }
.theme-crops { --sector-color: #15803d; --sector-bg: #f4fcf4; --sector-border: #86efac; }
.theme-livestock { --sector-color: #b45309; --sector-bg: #fffbeb; --sector-border: #fde68a; }
.theme-fishery { --sector-color: #0369a1; --sector-bg: #f0f9ff; --sector-border: #bae6fd; }

.sector-empty-hero {
  position: relative;
  min-height: 220px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  border-radius: 12px;
  border: 2px dashed var(--sector-border, #c3dec5);
  background: radial-gradient(circle at 50% 30%, var(--sector-bg, #f4f8f3), #ffffff);
  color: var(--sector-color, #1e6038);
  text-align: center;
}
.sector-empty-hero .hero-illustration-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.sector-empty-hero svg {
  width: 36px;
  height: 36px;
  stroke: var(--sector-color, #1e6038);
  stroke-width: 1.8;
  fill: none;
}
.sector-empty-hero span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.sector-empty-hero small {
  font-size: 12px;
  color: var(--muted);
}

.farm-detail-feature-empty {
  gap: 12px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}
.farm-detail-feature-empty svg {
  width: 58px;
  height: 58px;
  fill: none;
  stroke: #91a592;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.assistance-detail-symbol {
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  border: 1px solid #d7e5d6;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 202, 54, .28), transparent 32%),
    linear-gradient(135deg, #eff8f0, #fdfbf1);
  color: var(--primary-dark);
  text-decoration: none;
}
.assistance-detail-symbol svg {
  width: 74px;
  height: 74px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.assistance-detail-symbol span {
  position: static;
  background: var(--primary-dark);
}
.farm-detail-summary,
.crop-detail-summary {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(247, 250, 244, .92)),
    var(--surface);
}
.farm-detail-summary h3,
.crop-detail-summary h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}
.farm-detail-summary p,
.crop-detail-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.farm-detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.farm-detail-pills span {
  padding: 7px 12px;
  border-radius: 999px;
  background: #eaf4ec;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

/* Enhanced Detail Stat Grid Cards */
.detail-grid > div,
.farm-detail-grid > div,
.crop-detail-grid > div {
  position: relative;
  padding: 16px;
  border: 1px solid #e3ede2;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbf8 100%);
  box-shadow: 0 4px 12px rgba(20, 40, 25, 0.03);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.detail-grid > div:hover,
.farm-detail-grid > div:hover,
.crop-detail-grid > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 40, 25, 0.07);
  border-color: rgba(31, 122, 77, 0.3);
}
.farm-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.crop-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.farm-details-gallery { padding-top: 18px; border-top: 1px solid var(--line); }
.farm-details-gallery h3 { margin: 3px 0 0; font-size: 18px; }
.farm-detail-thumbs {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.farm-detail-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: block;
  border-radius: 10px;
  background: var(--surface-2);
}
.farm-detail-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
  transition: transform .2s ease, filter .2s ease;
}
.farm-detail-image span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(12, 36, 22, .80);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.farm-detail-image:hover img,
.farm-detail-image:focus-visible img {
  transform: scale(1.04);
  filter: saturate(1.06);
}
.farm-detail-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d8c6;
  border-radius: 10px;
  background: #fbfdfb;
}
.alert {
  position: relative;
  padding: 13px 16px 13px 42px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  font-weight: 600;
}
.alert::before {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}
.alert.success::before { content: "✓"; }
.alert.error::before { content: "!"; }
.alert.success { background: #edf8ef; color: #1b6b3d; }
.alert.error { background: #fff0ee; color: #9d2f24; }
.table-filter-toolbar {
  display: grid;
  gap: 12px;
  margin: 6px 0 16px;
}
.table-search-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 520px) auto;
  gap: 12px;
  align-items: center;
}
.table-search-control {
  display: grid;
  grid-template-columns: 1fr 48px;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(23, 53, 31, .06);
}
.table-live-search {
  height: 100%;
  border: 0;
  border-radius: 0;
  padding-left: 38px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667266' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.table-filter-toggle {
  min-height: 100%;
  width: 48px;
  padding: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #f7faf4;
  color: var(--primary-dark);
}
.table-filter-toolbar.is-open .table-filter-toggle {
  background: #edf8ef;
  color: var(--primary-dark);
}
.table-filter-grid {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fbfdfb;
}
.table-filter-grid[hidden] {
  display: none !important;
}
.table-filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.table-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 2px;
}
.table-filter-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.table-filter-reset {
  min-height: 36px;
  padding: 8px 12px;
}
.table-no-results {
  margin-top: 12px;
  padding: 24px 16px;
  border: 1px dashed #cbd7c9;
  border-radius: 8px;
  background: #fafcf9;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.table-no-results[hidden] {
  display: none;
}
.table-wrap {
  overflow-x: auto;
  scrollbar-color: #b9c8b7 transparent;
  scrollbar-width: thin;
}
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  background: #fbfcfa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}
tbody tr {
  transition: background .14s ease;
}
tbody tr:hover {
  background: #f8fbf7;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 38px 20px;
  font-weight: 600;
}
.report-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

.report-builder-panel {
  padding: 0;
  overflow: hidden;
}
.report-builder-panel > .panel-heading {
  padding: 22px 22px 0;
}
.report-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-builder-form {
  display: grid;
}
.report-primary-controls {
  display: grid;
  grid-template-columns: minmax(210px, .45fr) minmax(420px, 1.2fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 18px 22px 22px;
}
.report-search-field {
  min-width: 0;
}
.report-search-field input {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23647066' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
}
.report-filter-button[aria-expanded="true"] {
  border-color: #c3d8c4;
  background: #e5f0e3;
}
.report-filter-button {
  min-width: 112px;
  justify-content: center;
}
.report-result-count {
  align-self: center;
  padding: 0 4px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.report-filter-drawer {
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #f7faf5);
}
.report-filter-drawer[hidden] {
  display: none;
}
.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
}
.report-column-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.report-column-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.report-column-picker summary span {
  color: var(--muted);
  font-size: 11px;
}
.report-column-picker > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.report-column-picker label {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.report-column-picker input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.report-builder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 24, .06);
}
.report-summary-strip > div {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.report-summary-strip > div:last-child {
  border-right: 0;
}
.report-summary-strip span,
.report-summary-strip strong {
  display: block;
}
.report-summary-strip span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.report-summary-strip strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-results-heading {
  align-items: center;
}
.report-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.report-view-switch a {
  min-width: 74px;
  padding: 7px 11px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}
.report-view-switch a.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(23, 32, 24, .08);
}
.report-generated-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.report-limit-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: #fff9e8;
  color: #6e5a20;
  font-size: 12px;
  font-weight: 700;
}
.report-chart-box {
  position: relative;
  width: 100%;
  height: 420px;
}
.report-chart-box canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.report-empty-state {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.report-empty-state svg {
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  fill: none;
  stroke: #95a497;
  stroke-width: 1.6;
}
.report-empty-state strong {
  color: var(--text);
}
.report-empty-state span {
  font-size: 12px;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(300px, 88vw);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    border: 0;
    background: rgba(9, 23, 14, .56);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-nav-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-dark);
    cursor: pointer;
  }
  .mobile-nav-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 0;
    background: rgba(243, 246, 242, .94);
    backdrop-filter: blur(12px);
  }
  .sidebar-footer {
    display: none;
  }
  .brand {
    margin-bottom: 10px;
  }
  .nav {
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
  }
  .nav-section {
    margin-top: 28px;
    padding-top: 6px;
  }
  .nav-section:first-of-type {
    margin-top: 4px;
  }
  .stats-grid, .chart-grid { grid-template-columns: 1fr; }
  .dashboard-hero,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .hero-metrics {
    min-width: 0;
    width: 100%;
  }
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login-page {
    align-items: flex-start;
    padding: 18px;
  }
  .login-stage {
    min-height: auto;
    grid-template-columns: 1fr;
  }
  .login-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .form-grid, .form-grid.compact { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .report-primary-controls {
    grid-template-columns: minmax(190px, .65fr) minmax(240px, 1fr) auto;
  }
  .report-result-count {
    grid-column: 1 / -1;
  }
  .report-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-summary-strip > div:nth-child(2) {
    border-right: 0;
  }
  .report-summary-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .login-insights {
    grid-template-columns: 1fr;
  }
  .login-insights article {
    min-height: auto;
  }
  .table-wrap {
    overflow: visible;
  }
  table.responsive-table {
    min-width: 0;
    display: block;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tbody {
    display: grid;
    gap: 12px;
  }
  .responsive-table tbody tr {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .responsive-table tbody tr[hidden] {
    display: none;
  }
  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(108px, .42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }
  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .responsive-table td:last-child {
    border-bottom: 0;
  }
  .responsive-table td.empty {
    display: block;
    padding: 28px 16px;
  }
  .responsive-table td.empty::before {
    display: none;
  }
  .responsive-table .action-column {
    width: auto;
    text-align: left;
  }
  .responsive-table .table-actions {
    justify-content: flex-start;
  }
  .report-primary-controls {
    grid-template-columns: 1fr auto;
  }
  .report-primary-controls > label:first-of-type,
  .report-search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .main { padding: 14px; }
  .form-panel, .panel { padding: 16px; }
  .login-page {
    display: block;
    min-height: 100dvh;
    padding: 0;
  }
  .login-stage {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .login-hero, .login-panel { padding: 22px; }
  .login-copy h1 { font-size: clamp(30px, 10vw, 38px); line-height: 1.05; }
  .login-copy p { font-size: 14px; }
  .login-brand-mark { width: 46px; height: 46px; }
  .report-head { align-items: flex-start; flex-direction: column; }
  .topbar {
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .topbar-heading {
    flex: 1 1 auto;
  }
  .topbar-heading .eyebrow {
    display: none;
  }
  .topbar h1 {
    margin: 0;
    font-size: 20px;
  }
  .user-summary {
    display: none;
  }
  .user-dropdown summary {
    min-height: 42px;
    padding: 4px 6px;
  }
  .user-dropdown-menu {
    position: fixed;
    top: 68px;
    right: 14px;
    width: min(260px, calc(100vw - 28px));
  }
  .dashboard-stats,
  .hero-metrics,
  .form-grid,
  .form-grid.compact,
  .nav {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 14px;
  }
  .brand {
    padding-bottom: 12px;
  }
  .nav a {
    min-height: 42px;
  }
  .nav-label {
    white-space: normal;
  }
  .dashboard-hero {
    padding: 22px;
  }
  .metric-card {
    min-height: 104px;
  }
  .panel-heading,
  .activity-item {
    grid-template-columns: 1fr;
  }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .panel-heading .button { width: 100%; }
  .table-search-wrap {
    grid-template-columns: 1fr;
  }
  .table-filter-reset {
    width: 100%;
  }
  .table-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .table-filter-fields {
    grid-template-columns: 1fr;
  }
  .report-builder-panel > .panel-heading {
    padding: 18px 16px 0;
  }
  .report-output-actions,
  .report-output-actions .button {
    width: 100%;
  }
  .report-primary-controls,
  .report-filter-drawer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .report-filter-grid,
  .report-column-picker > div {
    grid-template-columns: 1fr;
  }
  .report-builder-actions {
    flex-direction: column-reverse;
  }
  .report-builder-actions .button {
    width: 100%;
  }
  .report-summary-strip {
    grid-template-columns: 1fr;
  }
  .report-summary-strip > div,
  .report-summary-strip > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .report-summary-strip > div:last-child {
    border-bottom: 0;
  }
  .report-summary-strip strong {
    white-space: normal;
  }
  .report-chart-box {
    height: 300px;
  }
  .record-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .record-dialog-header, .dialog-form { padding: 18px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .activity-item {
    align-items: start;
  }
  .activity-item em {
    justify-self: start;
  }
  .chart-box {
    height: 260px;
  }
  .profile-summary,
  .farm-detail-hero,
  .farm-detail-grid,
  .detail-grid,
  .rsbsa-groups {
    grid-template-columns: 1fr;
  }
  .farm-detail-feature,
  .farm-detail-feature img {
    min-height: 220px;
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
  .span-2 { grid-column: span 1; }
}

/* ═══ Farmer Profile Dialog Header Override ═══ */
.farmer-profile-dialog .record-dialog-header {
  background: #ffffff !important;
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 16px 24px !important;
}
.farmer-profile-dialog .record-dialog-header h2 {
  color: #0f172a !important;
  font-size: 20px !important;
}
.farmer-profile-dialog .record-dialog-header .eyebrow {
  color: #166534 !important;
}
.farmer-profile-dialog .dialog-close {
  color: #64748b !important;
  background: #f1f5f9 !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}
.farmer-profile-dialog .dialog-close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* ═══ Farmer Profile Hero Banner ═══ */
.farmer-profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 28px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #092e1b 0%, #134e2e 55%, #1b633b 100%);
  color: #ffffff;
  box-shadow: 0 12px 36px rgba(9, 46, 27, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}
.farmer-profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 85% 15%, rgba(244, 197, 77, 0.12) 0%, transparent 55%);
}
.farmer-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.farmer-hero-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f4c54d 0%, #e5b330 100%);
  color: #092e1b;
  font-size: 32px;
  font-weight: 900;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.farmer-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.farmer-hero-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid #092e1b;
}
.farmer-hero-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.farmer-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.farmer-hero-name-row h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.farmer-hero-type-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(244, 197, 77, 0.2);
  border: 1px solid rgba(244, 197, 77, 0.35);
  color: #ffe082;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.farmer-hero-verified-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  font-size: 11px;
  font-weight: 700;
}
.farmer-hero-subtitle {
  margin: 0;
  color: rgba(234, 246, 236, 0.85);
  font-size: 13.5px;
  line-height: 1.45;
}
.farmer-hero-subtitle strong { color: #ffffff; font-weight: 700; }
.farmer-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
  width: 100%;
  max-width: 540px;
}
.farmer-hero-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  backdrop-filter: blur(6px);
}
.farmer-hero-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}
.farmer-hero-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(244, 197, 77, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══ Farmer Info Cards Grid ═══ */
.farmer-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}
.farmer-info-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.farmer-info-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.farmer-info-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.farmer-info-card-head svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: #15803d;
}
.farmer-info-card-head span {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.farmer-info-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  flex: 1;
  gap: 0;
}
.farmer-info-card-body > div {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.farmer-info-card-body > div:nth-last-child(-n+2) { border-bottom: 0; }
.farmer-info-card-body > div:nth-child(odd) { border-right: 1px solid #f1f5f9; }
.farmer-info-card-body > div.span-2 { grid-column: 1 / -1; border-right: 0; }
.farmer-info-card-body span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 3px;
}
.farmer-info-card-body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}
.farmer-rsbsa-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  display: inline-block !important;
}
.farmer-rsbsa-verified { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.farmer-rsbsa-draft { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.farmer-rsbsa-pending { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

@media (max-width: 900px) {
  .farmer-profile-hero { flex-direction: column; text-align: center; }
  .farmer-hero-name-row { justify-content: center; }
  .farmer-hero-stats { justify-content: center; }
  .farmer-info-grid { grid-template-columns: 1fr; }
}

/* Profile farm gallery overrides */
.my-profile-panel .profile-farm-showcase {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 0;
  border: 1px solid rgba(22, 87, 63, .18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(6, 24, 19, .98), rgba(17, 84, 60, .94)),
    #0c2119;
  box-shadow: 0 24px 58px rgba(16, 35, 24, .18);
}
.my-profile-panel .profile-farm-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(244, 197, 77, .16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .18;
}
.my-profile-panel .profile-farm-showcase .profile-commodities-head {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.my-profile-panel .profile-farm-showcase .eyebrow {
  color: #f4c54d;
}
.my-profile-panel .profile-farm-showcase h3 {
  color: #fff;
  font-size: 22px;
}
.my-profile-panel .profile-farm-showcase .badge {
  background: rgba(244, 197, 77, .15);
  color: #fff7d1;
  border: 1px solid rgba(244, 197, 77, .3);
}
.my-profile-panel .profile-farm-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 0;
  align-items: stretch;
}
.my-profile-panel .profile-farm-feature {
  min-width: 0;
  min-height: 220px;
  height: 280px;
  max-height: 320px;
  border: 0;
  border-radius: 0;
  background: #102318;
  box-shadow: none;
}
.my-profile-panel .profile-farm-feature img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  height: 280px;
  max-height: 320px;
  display: block;
  object-fit: cover;
}
.my-profile-panel .profile-farm-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 50%, rgba(6, 24, 19, .26));
}
.my-profile-panel .profile-farm-feature > span {
  z-index: 1;
  right: 14px;
  bottom: 14px;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(6, 24, 19, .72);
  backdrop-filter: blur(10px);
}
.my-profile-panel .profile-farm-feature-copy {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.my-profile-panel .profile-farm-feature-copy h4 {
  color: #fff;
  font-size: clamp(20px, 2.2vw, 26px);
  margin-top: 4px;
  margin-bottom: 6px;
}
.my-profile-panel .profile-farm-feature-copy p {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.my-profile-panel .profile-farm-feature-copy .farm-detail-pills span {
  border-color: rgba(244, 197, 77, .22);
  background: rgba(244, 197, 77, .14);
  color: #fff7d1;
  font-size: 11px;
  padding: 3px 8px;
}
.my-profile-panel .profile-farm-strip {
  position: relative;
  z-index: 1;
  padding: 10px 14px 14px;
  margin: 0;
  background: rgba(255, 255, 255, .05);
}
.profile-farm-feature-wrap {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.gallery-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(6, 24, 19, 0.78);
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.18s ease;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.gallery-nav-arrow:hover {
  background: #f4c54d;
  color: #14492d;
  border-color: #f4c54d;
  transform: translateY(-50%) scale(1.1);
}
.gallery-nav-prev { left: 14px; }
.gallery-nav-next { right: 14px; }

.profile-farm-thumb {
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  padding: 0;
  height: 80px;
  overflow: hidden;
  transition: all 0.18s ease;
}
.profile-farm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-farm-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 197, 77, 0.6) !important;
}
.profile-farm-thumb.active {
  border: 2px solid #f4c54d !important;
  box-shadow: 0 0 16px rgba(244, 197, 77, 0.5) !important;
}

.my-profile-panel .profile-farm-empty {
  position: relative;
  z-index: 1;
  min-height: 240px;
  margin: 18px;
  border-color: rgba(244, 197, 77, .32);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.my-profile-panel .profile-farm-empty strong {
  color: #fff;
}
.my-profile-panel .profile-farm-empty span {
  color: rgba(255, 255, 255, .72);
}
.my-profile-panel .profile-commodities {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #d7e2d5;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fbf6);
}
.my-profile-panel .profile-commodities .profile-commodities-head {
  margin-bottom: 12px;
}
.my-profile-panel .commodity-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.my-profile-panel .commodity-chip-card {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(31, 122, 77, .18);
  background:
    linear-gradient(135deg, rgba(31, 122, 77, .10), transparent 45%),
    #fff;
  box-shadow: 0 14px 28px rgba(23, 32, 24, .06);
}
.my-profile-panel .commodity-chip-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), #f4c54d);
}
.farmer-profile-dialog {
  width: min(1220px, calc(100% - 34px));
  max-height: calc(100dvh - 32px);
  border: 1px solid rgba(244, 197, 77, .22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 247, .96)),
    radial-gradient(circle at 12% 0%, rgba(244, 197, 77, .18), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(31, 122, 77, .18), transparent 32%);
  box-shadow: 0 34px 90px rgba(5, 22, 12, .38);
}
.farmer-profile-dialog::backdrop {
  background: rgba(5, 18, 12, .66);
  backdrop-filter: blur(8px) saturate(1.1);
}
.farmer-profile-dialog .record-dialog-header {
  padding: 26px 28px 22px;
  border-bottom: 1px solid rgba(31, 122, 77, .14);
  background:
    linear-gradient(135deg, rgba(8, 39, 25, .96), rgba(20, 90, 57, .92)),
    linear-gradient(90deg, rgba(244, 197, 77, .18), transparent);
  color: #fff;
}
.farmer-profile-dialog .record-dialog-header::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 74px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(244, 197, 77, .72), transparent);
}
.farmer-profile-dialog .record-dialog-header .eyebrow {
  color: #f4c54d;
}
.farmer-profile-dialog .record-dialog-header h2 {
  color: #fff;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.05;
}
.farmer-profile-dialog .dialog-close {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(12px);
}
.farmer-profile-dialog .dialog-close:hover,
.farmer-profile-dialog .dialog-close:focus-visible {
  background: #f4c54d;
  color: #102318;
  transform: none;
}
.farmer-profile-dialog .record-view-content {
  padding: 0;
  gap: 0;
}
.farmer-profile-dialog .admin-profile-view {
  background:
    linear-gradient(90deg, rgba(31, 122, 77, .05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(31, 122, 77, .05) 1px, transparent 1px),
    #fbfdf9;
  background-size: 42px 42px;
}
.farmer-profile-dialog .my-profile-identity {
  margin: 0;
  padding: 28px;
  border-bottom: 1px solid rgba(31, 122, 77, .12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(239, 247, 236, .9));
}
.farmer-profile-dialog .profile-avatar-small {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  color: #0f4f32;
  background:
    linear-gradient(135deg, #f4c54d, #f0a90b);
  box-shadow: 0 18px 34px rgba(232, 163, 25, .24);
}
.farmer-profile-dialog .profile-avatar-small img {
  border-radius: 16px;
}
.farmer-profile-dialog .my-profile-identity h3 {
  font-size: clamp(26px, 2.4vw, 36px);
  letter-spacing: 0;
}
.farmer-profile-dialog .my-profile-identity p {
  font-size: 15px;
}
.farmer-profile-dialog .detail-grid {
  padding: 24px 28px 28px;
  gap: 14px;
  border-top: 0;
}
.farmer-profile-dialog .detail-grid > div {
  min-height: 90px;
  padding: 16px;
  border: 1px solid rgba(31, 122, 77, .15);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(242, 248, 239, .86));
  box-shadow: 0 12px 26px rgba(20, 50, 31, .06);
}
.farmer-profile-dialog .detail-grid span {
  color: #5d6d63;
  font-size: 11px;
  letter-spacing: .08em;
}
.farmer-profile-dialog .detail-grid strong {
  font-size: 17px;
  line-height: 1.25;
}
.farmer-profile-dialog .profile-farm-showcase {
  margin: 0 28px 24px;
  border-radius: 12px;
  border-color: rgba(244, 197, 77, .28);
  box-shadow: 0 26px 58px rgba(5, 22, 12, .22);
}
.farmer-profile-dialog .profile-farm-feature {
  min-height: 380px;
}
.farmer-profile-dialog .profile-farm-feature img {
  min-height: 380px;
}
.farmer-profile-dialog .profile-farm-feature-copy {
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
}
.farmer-profile-dialog .profile-commodities {
  margin: 0 28px 24px;
  border-radius: 12px;
  border-color: rgba(31, 122, 77, .14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(244, 249, 242, .95));
  box-shadow: 0 18px 40px rgba(23, 32, 24, .08);
}
.farmer-profile-dialog .commodity-chip-card {
  border-radius: 10px;
  border-color: rgba(31, 122, 77, .16);
}
.farmer-profile-dialog .actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  justify-content: flex-end;
  margin: 0;
  padding: 16px 28px;
  border-top: 1px solid rgba(31, 122, 77, .12);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
}
@media (max-width: 980px) {
  .my-profile-panel .profile-farm-feature-grid {
    grid-template-columns: 1fr;
  }
  .my-profile-panel .profile-farm-feature-copy {
    padding: 20px;
  }
  .farmer-profile-dialog .my-profile-identity,
  .farmer-profile-dialog .detail-grid,
  .farmer-profile-dialog .actions {
    padding-left: 18px;
    padding-right: 18px;
  }
  .farmer-profile-dialog .profile-farm-showcase,
  .farmer-profile-dialog .profile-commodities {
    margin-left: 18px;
    margin-right: 18px;
  }
  .farmer-profile-dialog .profile-farm-feature,
  .farmer-profile-dialog .profile-farm-feature img {
    min-height: 300px;
  }
}

@media (max-height: 720px) and (min-width: 981px) {
  .login-stage {
    min-height: auto;
  }
  .login-copy h1 {
    font-size: clamp(32px, 3.8vw, 48px);
  }
  .login-insights article {
    min-height: 108px;
    padding: 14px;
  }
  .login-insights span {
    margin-bottom: 10px;
  }
  .login-panel,
  .login-hero {
    padding-top: 28px;
    padding-bottom: 28px;
  }
}

@media print {
  .sidebar, .topbar, .no-print, .button, .alert, .skip-link, .report-summary-strip { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .panel { box-shadow: none; border: 0; }
  .print-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #17351f;
  }
  .print-brand img { width: 68px; height: 68px; object-fit: contain; }
  .print-brand div { display: grid; gap: 2px; }
  .print-brand strong { font-size: 17px; }
  .print-brand span { font-size: 13px; }
  .print-brand small { color: #566358; font-size: 11px; }
  table { min-width: 0; font-size: 12px; }
  .profile-summary,
  .farm-detail-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-summary article,
  .detail-grid > div {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Enhanced Farm Subsidy Reference Cards */
.subsidy-guide-panel {
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid rgba(22, 87, 63, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8f3 100%);
  box-shadow: 0 10px 30px rgba(23, 32, 24, 0.05);
}
.subsidy-guide-panel .panel-heading {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(31, 122, 77, 0.12);
}
.subsidy-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1100px) {
  .subsidy-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .subsidy-card-grid {
    grid-template-columns: 1fr;
  }
}

.subsidy-type-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid #e1ebe0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(18, 38, 26, 0.04);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.subsidy-type-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, #1e6038);
}
.subsidy-type-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(18, 38, 26, 0.10);
  border-color: rgba(31, 122, 77, 0.35);
}

.subsidy-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.subsidy-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--icon-bg, #eaf4e8);
  color: var(--card-accent, #1e6038);
}
.subsidy-icon-wrapper svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subsidy-card-body {
  display: grid;
  gap: 10px;
}
.subsidy-card-body h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text, #172018);
  line-height: 1.25;
}

.subsidy-example-box {
  padding: 8px 12px;
  border-radius: 6px;
  background: #f7faf6;
  border: 1px dashed rgba(31, 122, 77, 0.2);
  font-size: 13px;
  color: #2c3e2e;
  line-height: 1.45;
}
.subsidy-example-box strong {
  color: var(--primary-dark);
  font-weight: 700;
}

.subsidy-purpose-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #edf3eb;
  font-size: 12.5px;
  color: #586959;
  line-height: 1.4;
}
.subsidy-purpose-box svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #728a74;
  margin-top: 2px;
}

/* Card theme accents */
.card-input { --card-accent: #166534; --icon-bg: #dcfce7; }
.card-cash { --card-accent: #1d4ed8; --icon-bg: #dbeafe; }
.card-equipment { --card-accent: #0284c7; --icon-bg: #e0f2fe; }
.card-insurance { --card-accent: #d97706; --icon-bg: #fef3c7; }
.card-loan { --card-accent: #7c3aed; --icon-bg: #ede9fe; }
.card-training { --card-accent: #475569; --icon-bg: #f1f5f9; }

/* Enhanced Badges */
.badge {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.badge-input { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; font-weight: 700; }
.badge-cash { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; font-weight: 700; }
.badge-equipment { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; font-weight: 700; }
.badge-insurance { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-weight: 700; }
.badge-loan { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; font-weight: 700; }
.badge-training { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; font-weight: 700; }
.badge-bini { background: #ccfbf1; color: #115e59; border: 1px solid #99f6e4; font-weight: 700; }
.badge-ghost { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; font-weight: 700; }

/* Filter Pills Bar */
.subsidy-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8faf7;
  border: 1px solid #e2ece1;
  border-radius: 10px;
}
.filter-btn {
  padding: 6px 14px;
  border: 1px solid #d0ded0;
  border-radius: 999px;
  background: #ffffff;
  color: #3b4d3e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-dark, #16573f);
  color: #ffffff;
  border-color: var(--primary-dark, #16573f);
}

/* Quick Presets & Form Sections */
.form-section-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-dark, #16573f);
  margin-top: 10px;
  margin-bottom: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(31, 122, 77, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-chips-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: #f4f9f4;
  border: 1px dashed rgba(31, 122, 77, 0.3);
  border-radius: 8px;
}
.preset-chips-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
}
.preset-chip {
  padding: 4px 10px;
  border: 1px solid #c2dec7;
  border-radius: 6px;
  background: #ffffff;
  color: #1b4d2e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}


/* ==========================================================================
   Comprehensive All-Screen Responsiveness & Mobile Compatibility
   ========================================================================== */

/* Dialog & Popup Modals Responsiveness */
@media (max-width: 768px) {
  .record-dialog,
  .record-dialog-wide,
  .farmer-profile-dialog {
    width: calc(100% - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 10px auto !important;
    border-radius: 12px !important;
  }
  
  .record-dialog-header {
    padding: 16px 18px !important;
    gap: 12px !important;
  }
  
  .record-dialog-header h2 {
    font-size: clamp(18px, 4.5vw, 22px) !important;
  }

  .dialog-close {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    font-size: 22px !important;
  }

  .dialog-form {
    padding: 16px 18px 20px !important;
    grid-template-columns: 1fr !important;
  }

  .dialog-form .span-2,
  .dialog-form .span-3,
  .dialog-form .span-full {
    grid-column: 1 / -1 !important;
  }

  .dialog-actions {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-top: 12px !important;
  }

  .dialog-actions .button {
    flex: 1 1 auto !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

@media (max-width: 480px) {
  .record-dialog,
  .record-dialog-wide,
  .farmer-profile-dialog {
    width: calc(100% - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    margin: 6px auto !important;
    border-radius: 10px !important;
  }

  .record-dialog-header {
    padding: 14px 14px !important;
  }

  .dialog-form {
    padding: 14px 14px 16px !important;
  }
}

/* Report Builder & Navigation Responsiveness */
@media (max-width: 980px) {
  .panel-heading {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .report-output-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .report-output-actions .button,
  .report-output-actions a {
    flex: 1 1 calc(50% - 4px) !important;
    justify-content: center !important;
    font-size: 13px !important;
  }

  .report-primary-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .report-primary-controls label,
  .report-search-field {
    width: 100% !important;
  }

  .report-filter-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 580px) {
  .report-output-actions .button,
  .report-output-actions a {
    flex: 1 1 100% !important;
  }
}

/* Table Wrappers & Touch Device Responsiveness */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

@media (max-width: 768px) {
  .table-wrap table th,
  .table-wrap table td {
    padding: 10px 12px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }
}


/* Table Filter Text Input Styling */
.table-filter-text-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line, #d4e3d3);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text, #172018);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.table-filter-text-input:focus {
  outline: none;
  border-color: var(--primary, #15803d);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}



