/* Farmer navigation uses the same responsive shell tokens and interaction
   model as the admin navigation. Kept last in the cascade so legacy farmer
   and role-shell rules cannot turn the rail back into the old white drawer. */
body.farmer-shell {
  --sidebar-bg: #1f4d3a;
  --sidebar-width: 16.5rem;
  --sidebar-active: #a8d5b5;
}
body.farmer-shell.sidebar-collapsed { --sidebar-width: 4rem; }
body.farmer-shell.farmer-drawer-open { overflow: hidden; }

body.farmer-shell #sidebar.farmer-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: visible;
  color: rgba(255,255,255,.9);
  background: var(--sidebar-bg);
  border: 0;
  box-shadow: none;
  transform: none;
  transition: width .25s ease, transform .25s ease;
}
body.farmer-shell #sidebar.farmer-sidebar:hover { width: var(--sidebar-width); box-shadow: none; }
body.farmer-shell .farmer-sidebar .sidebar-brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 1rem .75rem .85rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.farmer-sidebar-header { display: flex; align-items: center; justify-content: space-between; min-height: 2rem; }
.farmer-wordmark { color: #fff; font-family: 'DM Serif Display', serif; font-size: 1.55rem; line-height: 1; }
.farmer-profile { display: flex; align-items: center; gap: .75rem; min-width: 0; padding-top: .85rem; }
.farmer-avatar,
.farmer-mobile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  overflow: hidden;
  border-radius: 50%;
  color: var(--sidebar-bg);
  background: #dceee2;
  font-size: 1.5rem;
  font-weight: 700;
}
.farmer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.farmer-avatar img + .farmer-initial { display: none; }
.farmer-initial { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-avatar i { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-avatar .farmer-initial { display: block; }
.farmer-profile .member-account-copy { flex: 1 1 auto; min-width: 0; }
body.farmer-shell .farmer-profile .member-account-name {
  display: -webkit-box;
  overflow: hidden;
  color: #fff !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
body.farmer-shell .farmer-profile .member-account-role { margin-top: .25rem; color: rgba(255,255,255,.72); font-size: .72rem; }
body.farmer-shell .farmer-sidebar .sidebar-collapse-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: .5rem;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.12);
}
body.farmer-shell .farmer-sidebar .sidebar-collapse-toggle:hover { background: rgba(255,255,255,.16); }

body.farmer-shell .farmer-sidebar .sidebar-nav {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: .75rem 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}
body.farmer-shell .farmer-sidebar .sidebar-nav > .nav {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 .6rem;
}
body.farmer-shell .farmer-sidebar .sidebar-nav::-webkit-scrollbar { width: .3rem; }
body.farmer-shell .farmer-sidebar .sidebar-nav::-webkit-scrollbar-thumb { border-radius: 1rem; background: rgba(255,255,255,.3); }
body.farmer-shell .farmer-sidebar .nav-item { width: 100%; min-width: 0; margin-bottom: .25rem; }
body.farmer-shell .farmer-sidebar .nav-link,
body.farmer-shell .farmer-sidebar .nav-group-toggle,
body.farmer-shell .farmer-sidebar .footer-icon-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .65rem .75rem;
  border: 0;
  border-radius: .75rem;
  color: rgba(255,255,255,.76);
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
body.farmer-shell .farmer-sidebar .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.farmer-shell .farmer-sidebar .nav-link > i:first-child { flex: 0 0 auto; width: 1.5rem; color: inherit; font-size: 1.2rem; text-align: center; }
body.farmer-shell .farmer-sidebar .nav-link:hover,
body.farmer-shell .farmer-sidebar .nav-group-toggle:hover,
body.farmer-shell .farmer-sidebar .footer-icon-link:hover { color: #fff; background: rgba(255,255,255,.08); }
body.farmer-shell .farmer-sidebar .nav-link:active,
body.farmer-shell .farmer-sidebar .nav-group-toggle:active { background: rgba(168,213,181,.65); }
body.farmer-shell .farmer-sidebar .nav-link.active {
  color: var(--sidebar-bg) !important;
  background: var(--sidebar-active);
  font-weight: 600;
}
body.farmer-shell .farmer-sidebar .nav-link.active i { color: var(--sidebar-bg) !important; }
body.farmer-shell .farmer-sidebar .nav-group-toggle.active-group:not(:hover) { color: #fff; }
body.farmer-shell .farmer-sidebar .group-chevron {
  flex: 0 0 auto;
  width: auto !important;
  margin-left: auto;
  color: #fff !important;
  opacity: 1;
  font-size: .8rem !important;
  transition: transform .2s ease;
}
body.farmer-shell .farmer-sidebar .nav-group.open .group-chevron { transform: rotate(180deg); }
body.farmer-shell .farmer-sidebar .nav-submenu { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .22s ease, opacity .15s ease; }
body.farmer-shell .farmer-sidebar .nav-group.open .nav-submenu { max-height: 12rem; opacity: 1; }
body.farmer-shell .farmer-sidebar .nav-sub-link { min-height: 2.55rem; padding-left: .75rem; font-size: .82rem; }
body.farmer-shell .farmer-sidebar .nav-sub-link > i:first-child { width: 1.5rem; font-size: .95rem; }
.role-entrepreneur .farmer-sidebar .nav-link-locked { opacity: .7; }
.role-entrepreneur .farmer-sidebar .nav-group-toggle > i:first-child,
.role-entrepreneur .farmer-sidebar .nav-group-toggle > .nav-label { opacity: .7; }
.role-entrepreneur .farmer-sidebar .nav-link-locked {
  cursor: not-allowed;
}
.role-entrepreneur .farmer-sidebar .nav-link-locked:hover { color: rgba(255,255,255,.76); background: rgba(255,255,255,.05); }
.role-entrepreneur .farmer-sidebar .nav-link-locked:focus-visible { outline: 2px solid var(--sidebar-active); outline-offset: -2px; }
.farmer-sidebar .nav-lock { flex: 0 0 auto; width: auto; margin-left: auto; font-size: .72rem; color: inherit; }
.farmer-sidebar .group-lock { margin-left: auto; }
.farmer-sidebar .group-lock + .group-chevron { margin-left: .35rem; }

body.farmer-shell .farmer-sidebar .sidebar-footer {
  position: relative;
  flex: 0 0 auto;
  margin-top: auto;
  padding: .75rem .75rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.15);
}
body.farmer-shell .farmer-sidebar .lang-switch-sidebar { margin-bottom: .4rem; background: rgba(255,255,255,.82); }
body.farmer-shell .farmer-sidebar .lang-switch-opt.active { background: var(--sidebar-bg); }
body.farmer-shell .farmer-sidebar .logout-link { justify-content: flex-start; }
body.farmer-shell .farmer-sidebar .logout-link:hover { color: #fff; background: rgba(255,255,255,.08); }
body.farmer-shell .farmer-sidebar .collapsed-language { display: none; position: relative; }
body.farmer-shell .language-popup {
  position: fixed;
  left: 4.4rem;
  bottom: 4.5rem;
  z-index: 1080;
  display: flex;
  gap: .25rem;
  padding: .35rem;
  border: 1px solid #e8eaed;
  border-radius: .7rem;
  background: #fff;
  box-shadow: 0 .75rem 2rem rgba(0,0,0,.2);
}
body.farmer-shell .language-popup button { min-height: 2.5rem; padding: .4rem .8rem; border: 0; border-radius: .5rem; color: var(--primary); background: transparent; }
body.farmer-shell .language-popup button.active { color: #fff; background: var(--sidebar-bg); }

body.farmer-shell #main-content {
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  overflow: hidden;
  transition: margin-left .25s ease, width .25s ease;
}
body.farmer-shell #main-content > main,
body.farmer-shell #main-content > main > * { min-width: 0; max-width: 100%; }
body.farmer-shell #main-content img { max-width: 100%; height: auto; }
body.farmer-shell #main-content .table-responsive { width: 100%; max-width: 100%; overflow-x: auto; }

/* Keep primary content headings readable and consistent across Farmer and
   Entrepreneur pages. The fluid value grows gently on wide displays without
   becoming oversized on ordinary laptops. */
body.farmer-shell #main-content .page-title,
body.farmer-shell #main-content .dash-welcome,
body.farmer-shell #main-content .page-heading {
  font-size: clamp(2rem, 2vw, 2.25rem) !important;
  line-height: 1.2;
}

/* Leave the notification control in a clear header row above the cards.
   This remains the same whether the optional account reminder is present. */
body.farmer-shell #main-content .dash-welcome,
body.farmer-shell #main-content .page-heading {
  margin-bottom: 2rem !important;
}
body.farmer-shell #main-content .account-setup-reminder {
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
}
.farmer-mobile-bar { display: none; }
.farmer-nav-flyout {
  position: fixed;
  left: 4.35rem;
  z-index: 1070;
  width: 13.5rem;
  max-height: min(15rem, calc(100dvh - 1rem));
  padding: .5rem;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .75rem;
  color: #fff;
  background: var(--sidebar-bg);
  box-shadow: 0 .75rem 2rem rgba(0,0,0,.24);
}
.farmer-nav-flyout-title { padding: .45rem .65rem .6rem; color: rgba(255,255,255,.62); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.farmer-nav-flyout .nav-link { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.75rem; padding: .6rem .7rem; border: 0; border-radius: .55rem; color: rgba(255,255,255,.82); background: transparent; font: inherit; text-align: left; text-decoration: none; }
.farmer-nav-flyout .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.farmer-nav-flyout .nav-link.active { color: var(--sidebar-bg); background: var(--sidebar-active); }

body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-brand { min-height: 7rem; padding: .75rem .5rem; justify-content: flex-start; align-items: center; gap: .6rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .farmer-sidebar-header { justify-content: center; width: 100%; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .farmer-profile { order: -1; padding-top: 0; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .farmer-wordmark,
body.farmer-shell.sidebar-collapsed .farmer-sidebar .member-account-copy,
body.farmer-shell.sidebar-collapsed .farmer-sidebar .nav-label { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .farmer-avatar i { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .farmer-avatar img + .farmer-initial { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .farmer-avatar .farmer-initial { display: block; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-collapse-toggle { border: 2px solid var(--sidebar-bg); color: var(--sidebar-bg); background: var(--sidebar-active); }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-nav { padding-inline: 0; scrollbar-width: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-nav > .nav { padding-inline: .5rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-nav::-webkit-scrollbar { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .nav-link { justify-content: center; gap: 0; padding-inline: .35rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .nav-link > i:first-child { font-size: 1.35rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .group-chevron { position: absolute; right: .2rem; bottom: .25rem; display: block; font-size: .52rem !important; }
body.farmer-shell.sidebar-collapsed .role-entrepreneur .farmer-sidebar .group-chevron { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .group-lock { position: absolute; right: .18rem; bottom: .2rem; margin: 0; font-size: .58rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .nav-submenu { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .expanded-language { display: none; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .collapsed-language { display: block; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-footer { padding-inline: .5rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar .sidebar-footer .nav-link,
body.farmer-shell.sidebar-collapsed .farmer-sidebar .footer-icon-link { justify-content: center; padding-inline: .35rem; }
body.farmer-shell.sidebar-collapsed .farmer-sidebar [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + .65rem);
  top: 50%;
  z-index: 1090;
  padding: .4rem .6rem;
  border-radius: .4rem;
  color: #fff;
  background: #16392c;
  font-size: .75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(.25rem, -50%);
  transition: opacity .15s ease, transform .15s ease;
}
body.farmer-shell.sidebar-collapsed .farmer-sidebar [data-tooltip]:hover::after { opacity: 1; transform: translate(0, -50%); }

@media (min-width: 768px) and (max-width: 1023.98px) {
  body.farmer-shell { --sidebar-width: 4rem; }
  body.farmer-shell #sidebar.farmer-sidebar { inset: 0 auto 0 0; width: 4rem; transform: none; }
  body.farmer-shell #sidebar.farmer-sidebar.show { width: 16.5rem; }
  body.farmer-shell .farmer-sidebar.show .sidebar-brand { min-height: 0; padding: 1rem .75rem .85rem; align-items: stretch; gap: 0; }
  body.farmer-shell .farmer-sidebar.show .farmer-sidebar-header { justify-content: space-between; }
  body.farmer-shell .farmer-sidebar.show .farmer-profile { order: initial; padding-top: .85rem; }
  body.farmer-shell .farmer-sidebar.show .farmer-wordmark,
  body.farmer-shell .farmer-sidebar.show .member-account-copy,
  body.farmer-shell .farmer-sidebar.show .nav-label { display: block; }
  body.farmer-shell .farmer-sidebar.show .farmer-avatar i { display: block; }
  body.farmer-shell .farmer-sidebar.show .farmer-avatar img { display: block; }
  body.farmer-shell .farmer-sidebar.show .farmer-initial { display: none; }
  body.farmer-shell .farmer-sidebar.show .sidebar-collapse-toggle { border: 0; color: #fff; background: rgba(255,255,255,.12); }
  body.farmer-shell .farmer-sidebar.show .nav-link { justify-content: flex-start; gap: .7rem; padding-inline: .75rem; }
  body.farmer-shell .farmer-sidebar.show .nav-submenu { display: block; }
  body.farmer-shell .farmer-sidebar.show .group-chevron { position: static; margin-left: auto; font-size: .8rem !important; }
  body.farmer-shell .farmer-sidebar.show .expanded-language { display: block; }
  body.farmer-shell .farmer-sidebar.show .collapsed-language { display: none; }
  body.farmer-shell .farmer-sidebar.show .sidebar-footer { padding-inline: .75rem; }
  body.farmer-shell .farmer-sidebar.show [data-tooltip]::after { display: none; }
  body.farmer-shell .farmer-sidebar-overlay.show { display: block; opacity: 1; visibility: visible; }
  body.farmer-shell #main-content { width: calc(100% - 4rem); min-width: 0; margin-left: 4rem !important; padding-top: 0 !important; padding-inline: 0 !important; overflow-x: clip; }
  body.farmer-shell #main-content > main { width: 100%; padding: 0 clamp(.85rem, 2vw, 1.25rem) 1.5rem !important; }
  body.farmer-shell #main-content .page-title {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    margin: 0 0 1.25rem;
    padding: 0 3rem 0 0;
    overflow: visible;
    color: var(--text, #1a1a2e);
    background: transparent;
    font-size: clamp(1.75rem, 3.5vw, 2.05rem) !important;
    line-height: 1.2;
    white-space: normal;
  }
  body.farmer-shell #main-content .dash-welcome,
  body.farmer-shell #main-content .page-heading {
    margin-top: 0;
    font-size: clamp(1.75rem, 3.5vw, 2.05rem) !important;
    line-height: 1.2;
  }
  body.farmer-shell .farmer-desktop-actions {
    position: absolute;
    inset: 1rem 1.25rem auto auto;
    z-index: 30;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: .5rem;
    min-height: 0;
    margin: 0;
  }
  body.farmer-shell .farmer-desktop-actions .notification-bell-btn {
    position: relative;
    inset: auto;
    width: 2.25rem;
    height: 2.25rem;
    border: 1.5px solid var(--border, #d8dfd9);
    border-radius: .6rem;
    color: var(--text-dark, #1e4d3a);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
  }
  body.farmer-shell .farmer-desktop-actions .notification-bell-btn i { font-size: 1.05rem; }
}

@media (max-width: 767.98px) {
  body.farmer-shell { --sidebar-width: 0rem; }
  body.farmer-shell .farmer-mobile-bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1035;
    display: flex;
    align-items: center;
    height: calc(3.75rem + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) .75rem 0;
    color: #fff;
    background: var(--sidebar-bg);
  }
  .farmer-mobile-menu { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: .6rem; color: #fff; background: transparent; font-size: 1.65rem; }
  .farmer-mobile-wordmark { margin-left: .35rem; color: #fff; font-family: 'DM Serif Display', serif; font-size: 1.35rem; line-height: 1; }
  .farmer-mobile-actions { margin-left: auto; }
  body.farmer-shell .farmer-mobile-actions .notification-bell-btn { position: relative; inset: auto; display: flex; width: 2.75rem; height: 2.75rem; color: #fff; }
  body.farmer-shell .farmer-desktop-actions { display: none; }
  body.farmer-shell #sidebar.farmer-sidebar { inset: 0 auto 0 0; width: min(17.5rem, 85vw); transform: translateX(-100%); }
  body.farmer-shell #sidebar.farmer-sidebar.show { width: min(17.5rem, 85vw); transform: translateX(0); }
  /* A translated fixed layer can briefly be composited without its clipping
     during an Inertia page swap on mobile Chrome. Hide the closed drawer's
     entire paint tree so its avatar, wordmark and language switch cannot
     flash over the destination page. */
  body.farmer-shell #sidebar.farmer-sidebar:not(.show) {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
  body.farmer-shell #sidebar.farmer-sidebar.show {
    visibility: visible;
    opacity: 1;
  }
  body.farmer-shell .farmer-sidebar .sidebar-brand { min-height: 0; padding: 1rem .75rem .85rem; align-items: stretch; }
  body.farmer-shell .farmer-sidebar .sidebar-collapse-toggle { display: none; }
  body.farmer-shell .farmer-sidebar .farmer-wordmark,
  body.farmer-shell .farmer-sidebar .member-account-copy,
  body.farmer-shell .farmer-sidebar .nav-label { display: block; }
  body.farmer-shell .farmer-sidebar .nav-link { justify-content: flex-start; gap: .7rem; padding-inline: .75rem; }
  body.farmer-shell .farmer-sidebar .nav-submenu { display: block; }
  body.farmer-shell .farmer-sidebar .group-chevron { position: static; margin-left: auto; font-size: .8rem !important; }
  body.farmer-shell .farmer-sidebar .expanded-language { display: block; }
  body.farmer-shell .farmer-sidebar .collapsed-language { display: none; }
  body.farmer-shell .farmer-sidebar-overlay.show { display: block; opacity: 1; visibility: visible; }
  body.farmer-shell #main-content { width: 100%; margin-left: 0; padding-top: calc(3.75rem + env(safe-area-inset-top)); padding-inline: 0 !important; }
  body.farmer-shell #main-content > main {
    width: 100%;
    padding: 0 .75rem calc(1.5rem + env(safe-area-inset-bottom)) !important;
  }

  /* The member shell has its own fixed mobile bar. Keep the current page
     name in the content below that bar, as the admin shell does, instead
     of leaving the legacy fixed title hidden underneath the mobile bar. */
  body.farmer-shell #main-content .page-title {
    position: static;
    inset: auto;
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 1.25rem;
    padding: 0;
    overflow: visible;
    color: var(--text, #1a1a2e);
    background: transparent;
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.65rem, 7vw, 1.9rem) !important;
    line-height: 1.2;
    white-space: normal;
    text-overflow: clip;
  }

  /* Farmer and Entrepreneur dashboard greetings use the same responsive
     content-heading scale as Admin instead of separate 22px/23px sizes. */
  body.farmer-shell #main-content .dash-welcome,
  body.farmer-shell #main-content .page-heading {
    margin-top: 0;
    font-size: clamp(1.65rem, 7vw, 1.9rem) !important;
    line-height: 1.2;
  }

  body.farmer-shell #main-content > main > .page-title {
    margin-bottom: 1.25rem !important;
  }

  /* Dashboard already has its personalized Welcome heading, so do not
     repeat the selected navigation label inside the page content. */
  body.farmer-shell #main-content .dash-page-title { display: none !important; }

  /* Legacy profile rules right-aligned the wrapper when its title lived in
     the old top bar. The title is now in normal flow, so align it with every
     other member-page heading. */
  body.farmer-shell #main-content .profile-header {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 1.25rem;
  }

  /* Production's old responsive rule right-aligned this wrapper because
     its title previously lived in the top bar. Keep the title in the same
     left column as every other page; space-between still accommodates the
     Add Record button at widths where it remains visible. */
  body.farmer-shell #main-content .prod-header {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
  }

  /* Keep the native month picker's anchor on the safe (left) side of the
     viewport. Native picker panels are browser UI and cannot be resized by
     CSS, but opening from this position keeps the full panel on-screen. */
  body.farmer-shell #main-content .income-header {
    width: 100%;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: .75rem !important;
    /* The following Bootstrap gutter already supplies the content gap. */
    margin-bottom: 0;
  }
  body.farmer-shell #main-content .income-header .income-month-input {
    width: max-content !important;
    max-width: 100%;
    min-width: 0;
    margin-right: 0;
    margin-left: 0;
  }

  /* Header wrappers own the gap below the title. Their nested title must
     not add another margin, which keeps Farmer and Entrepreneur pages in
     the same vertical position as the dashboard sample. */
  body.farmer-shell #main-content > main > .profile-header .page-title,
  body.farmer-shell #main-content > main > .prod-header .page-title,
  body.farmer-shell #main-content > main > .income-header .page-title,
  body.farmer-shell #main-content > main > .announcement-page-header .page-title {
    margin-bottom: 0 !important;
  }

  body.farmer-shell #main-content > main > .announcement-page-header {
    margin-bottom: 1.25rem !important;
  }
}

@media (max-height: 479.98px) {
  body.farmer-shell .farmer-sidebar .sidebar-brand { padding-top: .55rem; padding-bottom: .55rem; }
  body.farmer-shell .farmer-sidebar .farmer-profile { padding-top: .45rem; }
  body.farmer-shell .farmer-sidebar .sidebar-footer { padding-top: .45rem; padding-bottom: calc(.55rem + env(safe-area-inset-bottom)); }
  body.farmer-shell .farmer-sidebar .lang-switch-sidebar { margin-bottom: .15rem; }
}

@media (hover: none) {
  body.farmer-shell.sidebar-collapsed .farmer-sidebar [data-tooltip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body.farmer-shell .farmer-sidebar,
  body.farmer-shell #main-content,
  body.farmer-shell .nav-submenu,
  body.farmer-shell .group-chevron { scroll-behavior: auto; transition: none; }
}
