:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9dee5;
  --text: #1f2933;
  --muted: #66707a;
  --accent: #8B4513;
  --accent-2: #37679b;
  --good: #2f6f3e;
  --warn: #8a6d1f;
  --soft: #eef3f8;
  --shadow: 0 10px 24px rgba(20, 30, 40, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

.adv-cattle-page {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13.5px;   /* <-- ADD THIS LINE */
  background: var(--bg);
  color: var(--text);
}

.adv-cattle-page .container {
  max-width: 100%;
  width: 100%;
}

.adv-cattle-page .search-card {
  margin-bottom: 12px;  /* was 18px */
}

/* reduce top padding on page shell */
.adv-cattle-page .page-shell {
  padding-top: 90px;  /* change to: */
  padding-top: 20px;
}

.adv-cattle-page .topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

.adv-cattle-page .title-block h1 {
  margin: 0 0 6px;
  font-size: 30px;
  color: #18324d;
}

.adv-cattle-page .title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.adv-cattle-page .toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
}

.adv-cattle-page .title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.adv-cattle-page .title-block h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.15;
  color: #18324d;
}

.adv-cattle-page .title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.adv-cattle-page .searchbox {
  min-width: 260px;
  display: flex;
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
}

.adv-cattle-page .searchbox input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 14px;
  height: 30px;
  line-height: 30px;
}

.adv-cattle-page .btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  transition: all .15s ease;
}

.adv-cattle-page .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(20, 48, 78, .15);
}

.adv-cattle-page .btn.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid #c7d4e2;
}

.adv-cattle-page .btn.secondary:hover {
  background: #f4f8fc;
  border-color: var(--accent);
}

.adv-cattle-page .btn.secondary {
  background: #fff;
  color: var(--accent);
}

.adv-cattle-page .selected-lot {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 12px;
}

.adv-cattle-page .selected-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}

.adv-cattle-page .eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  font-size: 0.7rem;
  background: #eee;
  border-radius: 999px;
}

.adv-cattle-page .selected-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.2;
  color: #16314d;
}

.adv-cattle-page .selected-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.adv-cattle-page .detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.adv-cattle-page .detail-card {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.adv-cattle-page .detail-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.adv-cattle-page .detail-card .value {
  font-size: 16px;
  font-weight: 700;
  color: #203448;
}

.adv-cattle-page .detail-card .subvalue {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.adv-cattle-page .notes-box,
.adv-cattle-page .sale-box,
.adv-cattle-page .traits-box {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.adv-cattle-page .section-title {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.adv-cattle-page .notes-box p,
.adv-cattle-page .sale-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #314355;
}

.adv-cattle-page .notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.adv-cattle-page .notes-status {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
}

/* ── Notes row: Comments + Photo as SEPARATE side-by-side cards ──
   .notes-row is a flex container holding .notes-box (Comments) and,
   only when the selected listing has photos, a second sibling card
   .photo-box created by JS (renderNotesPhotoPanel). With no photo,
   .notes-row has a single child and .notes-box naturally fills the
   row — same as before this feature existed. */

.adv-cattle-page .notes-row {
  display: flex;
  gap: 14px;
  align-items: stretch; /* Comments and Photo cards match height to
                            whichever is naturally taller, instead of
                            each sizing to its own content. */
}

.adv-cattle-page .notes-row > .notes-box {
  flex: 1;
  min-width: 0; /* allow long comment text to wrap instead of forcing the row wider */
  display: flex;
  flex-direction: column;
}

.adv-cattle-page .photo-box {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* keeps thumb + "Show All" centered even
                               when stretched taller than its own
                               content (e.g. a long Comments card). */
  gap: 6px;
}

.adv-cattle-page .notes-photo-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.adv-cattle-page .notes-photo-showall {
  background: none;
  border: none;
  color: #16314d;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.adv-cattle-page .notes-photo-showall:hover {
  color: #8B4513;
}

/* Expanded strip — a SEPARATE element below .selected-top entirely
   (a sibling of .selected-top inside <section class="selected-lot">,
   see go_feeder_search.prg), not nested inside .notes-row or
   .photo-box. This spans the full width of the "Selected Listing"
   panel, including underneath .side-stack (Programs/Vaccinations/
   Marketing) on the right, while staying inside the panel's own
   border. Hidden by default (inline style + JS toggle); only laid
   out as a grid once .expanded is added. */
.adv-cattle-page .notes-photo-strip-wrap.expanded {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.adv-cattle-page .notes-photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adv-cattle-page .notes-photo-strip-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer; /* clicking opens the original-size photo in a new tab */
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.adv-cattle-page .notes-photo-strip-img:hover,
.adv-cattle-page .notes-photo-strip-img:focus-visible {
  transform: scale(1.04);
  border-color: #8B4513;
  outline: none;
}

/* Mobile: same 700px breakpoint .detail-grid already collapses at.
   Comments and Photo stack instead of sitting side by side, since
   there's no horizontal room to spare once the page is already down
   to a single column. Photo card moves above the comment text. */
@media (max-width: 700px) {
  .adv-cattle-page .notes-row {
    flex-direction: column;
  }

  .adv-cattle-page .notes-row > .notes-box {
    order: 2;
  }

  .adv-cattle-page .photo-box {
    order: 1;
    flex: none;
    align-items: flex-start;
  }

  .adv-cattle-page .notes-photo-strip-img {
    width: calc(33.333% - 6px);
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

.adv-cattle-page .side-stack {
  display: grid;
  gap: 14px;
}

.adv-cattle-page .side-stack > div {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}


.adv-cattle-page .trait-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e7ebef;
  font-size: 14px;
}

.adv-cattle-page .trait-row:last-child { border-bottom: 0; }
.adv-cattle-page .trait-row strong { color: #16314d; }

.adv-cattle-page .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.adv-cattle-page .tag {
  display: inline-block;
  background: #eef4ea;
  color: var(--good);
  border: 1px solid #d9e7d9;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.adv-cattle-page .tag.warn {
  background: #fbf4df;
  color: var(--warn);
  border-color: #eddca5;
}

.adv-cattle-page .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.adv-cattle-page .content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.adv-cattle-page .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.adv-cattle-page .panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.adv-cattle-page .panel-header h2 {
  margin: 0;
  font-size: 20px;
  color: #18324d;
}

.adv-cattle-page .panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.adv-cattle-page .sort-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.adv-cattle-page .pill {
  border: 1px solid var(--line);
  background: #fff;
  color: #314355;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.adv-cattle-page .pill.active {
  background: #eaf1f8;
  border-color: #cddbeb;
  color: var(--accent);
}

.adv-cattle-page .listing-wrap {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.adv-cattle-page .listing-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  display: grid;
  grid-template-columns: 88px 1.5fr 1fr 1fr;
  gap: 14px;
  align-items: start;
  cursor: pointer;
}

.adv-cattle-page .listing-card.active {
  border-color: #b7cce2;
  box-shadow: 0 0 0 2px rgba(55, 103, 155, 0.12);
}

.adv-cattle-page .listing-card + .listing-card {
  margin-top: 14px;
}
.adv-cattle-page .rankbox {
  background: #f1f6fb;
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  text-align: center;
  padding: 12px 8px;
}

.adv-cattle-page .rankbox .rank {
  font-size: 24px;
  font-weight: 800;
  color: #18324d;
  line-height: 1;
}

.adv-cattle-page .rankbox .score {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.adv-cattle-page .lot-headline {
  margin: 0 0 6px;
  font-size: 19px;
  color: #18324d;
}

.adv-cattle-page .lot-meta,
.adv-cattle-page .mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #334658;
}

.adv-cattle-page .mini-list li span,
.adv-cattle-page .lot-meta li span {
  color: var(--muted);
  display: inline-block;
  min-width: 86px;
  font-weight: 700;
}

.adv-cattle-page .epd-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.adv-cattle-page .epd-pill {
  background: #f3f7fa;
  border: 1px solid #dde5ec;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #28435e;
}

.adv-cattle-page .filters {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.adv-cattle-page .filter-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfcfd;
}

.adv-cattle-page .filter-group h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #18324d;
}

.adv-cattle-page .filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adv-cattle-page .filter-group input,
.adv-cattle-page .filter-group select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
  background: #fff;
  margin-bottom: 10px;
}

.adv-cattle-page .two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.adv-cattle-page .checklist {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #314355;
}

.adv-cattle-page .checklist label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  color: #314355;
  font-weight: 600;
}

.adv-cattle-page .footer-note {
  padding: 12px 18px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.adv-cattle-page .is-hidden { display: none !important; }

@media (max-width: 1180px) {
  .adv-cattle-page .selected-top,
  .adv-cattle-page .content-grid,
  .adv-cattle-page .listing-card {
    grid-template-columns: 1fr;
  }

  .adv-cattle-page .detail-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 700px) {
  .adv-cattle-page .detail-grid,
  .adv-cattle-page .two-up {
    grid-template-columns: 1fr;
  }

  .adv-cattle-page .searchbox {
  min-width: 260px;
  display: flex;
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 10px;
}

.adv-cattle-page .searchbox input {
  height: 28px;
  line-height: 28px;
}

  .adv-cattle-page .title-block h1 {
    font-size: 24px;
  }
}

.lot-epdline {
  font-size: 0.75rem;
  color: #c0c0c0;
  margin-top: 4px;
}

.panel-header p.results-bar {
  margin: 2px 0 0;
  font-size: 13px;
  color: #666;
}

#breedPrevBtn:disabled,
#breedNextBtn:disabled {
  opacity: 0.45;
  cursor: default;
}

.sort-row .pill {
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sort-row .pill:hover {
  background: #e6eef7;
  border-color: #bcd0e5;
  color: #18324d;
}

.adv-cattle-page .lot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.adv-cattle-page .lot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #c9d3df;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.adv-cattle-page .lot-pill:hover {
  text-decoration: none;
}

.adv-cattle-page .lot-pill-light {
  background: #fff;
  color: #234a75;
}

.adv-cattle-page .lot-pill-light:hover {
  background: #f4f7fb;
  border-color: #b8c7d9;
}

.adv-cattle-page .lot-pill-accent {
  background: #eaf2fb;
  color: #1f4f82;
  border-color: #c7d8eb;
}

.adv-cattle-page .lot-pill-accent:hover {
  background: #dfeaf8;
}

.adv-cattle-page .lot-pill-dark {
  background: #234a75;
  color: #fff;
  border-color: #234a75;
}

.adv-cattle-page .lot-pill-dark:hover {
  background: #1b3b5f;
  border-color: #1b3b5f;
}
/* Fix embedding under the BlockTrust v2 fixed header */
.da-header ~ .panel-body .adv-cattle-page .page-shell,
.da-header-2 ~ .panel-body .adv-cattle-page .page-shell {
  padding-top: 110px;
}

/* Force native selects inside the cattle search */
.adv-cattle-page .select {
  display: block !important;
}

.adv-cattle-page .custom-select,
.adv-cattle-page .select-options {
  display: none !important;
}

.adv-cattle-page select,
.adv-cattle-page select.hide-select {
  display: block !important;
  width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: static !important;
  pointer-events: auto !important;
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  appearance: auto !important;
}

/* Feeder listing input page - match search UI */
.native-select-page {
    background: #f3f6fa;
    min-height: 100vh;
    padding: 18px 0 40px;
}

.native-select-page .page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.native-select-page .card {
    border: 1px solid #d6dee8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 35, 55, 0.06);
    overflow: hidden;
}

.native-select-page .card-header {
    background: #ffffff;
    border-bottom: 1px solid #e1e7ef;
    padding: 18px 20px;
}

.native-select-page .card-header h5 {
    margin: 0;
    color: #12365c;
    font-size: 24px;
    font-weight: 500;
}

.native-select-page .card-body {
    padding: 22px 20px;
}

.native-select-page h6 {
    color: #006cff !important;
    font-size: 14px;
    font-weight: 700 !important;
    margin: 8px 0 12px;
}

.native-select-page .form-group {
    margin-bottom: 14px;
}

.native-select-page label {
    color: #1a2f47;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
}

.native-select-page .form-control,
.native-select-page .form-select,
.native-select-page select,
.native-select-page textarea,
.native-select-page input[type="text"],
.native-select-page input[type="number"],
.native-select-page input[type="date"] {
    border: 1px solid #d2dbe7;
    border-radius: 9px;
    background: #ffffff;
    color: #12263f;
    font-size: 14px;
    min-height: 38px;
    box-shadow: none;
}

.native-select-page textarea.form-control {
    min-height: 68px;
}

.native-select-page .form-control:focus,
.native-select-page .form-select:focus,
.native-select-page select:focus,
.native-select-page textarea:focus,
.native-select-page input:focus {
    border-color: #8db7e8;
    box-shadow: 0 0 0 3px rgba(43, 105, 170, 0.12);
    outline: none;
}

.native-select-page hr {
    border: 0;
    border-top: 1px solid #e1e7ef !important;
    margin: 20px 0 14px;
}

.native-select-page a {
    color: #5f6f83;
    font-size: 13px;
    text-decoration: none;
}

.native-select-page a:hover {
    color: #234f82;
    text-decoration: underline;
}

.native-select-page .btn-outline-secondary,
.native-select-page #addAnotherProductRow {
    border: 1px solid #b9c7d6;
    color: #234f82;
    background: #ffffff;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
}

.native-select-page .btn-outline-secondary:hover,
.native-select-page #addAnotherProductRow:hover {
    background: #eef3f8;
    color: #12365c;
}

.native-select-page .submitBtn,
.native-select-page .butn-style3 {
    background: #234f82;
    border: 1px solid #234f82;
    color: #ffffff;
    border-radius: 9px;
    padding: 10px 24px;
    font-weight: 700;
}

.native-select-page .submitBtn:hover,
.native-select-page .butn-style3:hover {
    background: #16395f;
    border-color: #16395f;
}

.native-select-page .popup {
    border: 1px solid #d2dbe7;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 35, 55, 0.16);
    padding: 14px;
    margin-top: 8px;
}

/* =========================================================
   FEEDER / ADV CATTLE FORM IMPROVEMENTS
   - Modern spacing
   - Softer text
   - Cleaner inputs
   ========================================================= */

/* ---------- Layout Spacing ---------- */

.adv-cattle-page .row {
    margin-bottom: 18px;
}

.adv-cattle-page .form-group {
    margin-bottom: 18px;
}

.adv-cattle-page h6 {
    margin-top: 26px;
    margin-bottom: 12px;
    font-weight: 600;
}

.adv-cattle-page hr {
    margin: 24px 0;
    border-color: #e0e0e0;
}


/* ---------- Labels ---------- */

.adv-cattle-page label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}


/* ---------- Inputs / Selects / Textareas ---------- */

.adv-cattle-page input.form-control,
.adv-cattle-page textarea.form-control,
.adv-cattle-page select.form-control,
.adv-cattle-page select.form-select {
    padding: 10px 12px;
    font-size: 14px;
    color: #444;                 /* softer than black */
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.15s ease;
}


/* ---------- Focus State (important for polish) ---------- */

.adv-cattle-page input.form-control:focus,
.adv-cattle-page textarea.form-control:focus,
.adv-cattle-page select.form-control:focus,
.adv-cattle-page select.form-select:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
    outline: none;
}


/* ---------- Textarea refinement ---------- */

.adv-cattle-page textarea.form-control {
    padding: 12px;
    line-height: 1.5;
}


/* ---------- Dropdown text specifically ---------- */

.adv-cattle-page select.form-control,
.adv-cattle-page select.form-select {
    color: #444;
}

/* ---------- Section breathing room ---------- */

.adv-cattle-page .product-row {
    margin-bottom: 14px;
}

/* =========================================================
   MODERN PRIMARY BUTTON
   ========================================================= */

.adv-cattle-page .btn-modern-primary {
    display: inline-block;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: #007AFF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover */
.adv-cattle-page .btn-modern-primary:hover {
    background-color: #0066d6;
    transform: translateY(-1px);
}

/* Active (click) */
.adv-cattle-page .btn-modern-primary:active {
    transform: translateY(0);
    background-color: #005bb5;
}

/* Focus */
.adv-cattle-page .btn-modern-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.25);
}

.add-product-link {
    font-size: 11px;
    color: #007bff;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 400;
}

.add-product-link:hover {
    text-decoration: underline;
}

.delete-product-row-btn {
    border: 1px solid #ccc;
    background: transparent;
    color: #666;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.delete-product-row-btn:hover {
    border-color: #999;
    color: #333;
    background: #f8f8f8;
}

.delete-product-row {
    border: 1px solid #ccc;
    background: transparent;
    color: #555;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
}

/* Hover */
.delete-product-row:hover {
    border-color: #999;
    background: #f8f8f8;
    color: #333;
}

/* REMOVE ugly focus ring */
.delete-product-row:focus {
    outline: none;
    box-shadow: none;
}

#addAnotherProductRow {
    font-size: 13px;
    padding: 5px 10px;
}

.product-row {
    margin-bottom: 12px !important;
}

.add-another-btn {
    border: 1px solid #ccc;
    background: transparent;
    color: #555;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: none;
}

.add-another-btn:hover {
    border-color: #999;
    background: #f8f8f8;
    color: #333;
}

.use-prev-date {
  color: #007bff !important;
  text-decoration: none;
  cursor: pointer;
}

.use-prev-date:hover {
  text-decoration: underline;
}

.btn-doc-upload {
  margin-bottom: 6px;
}

.btn-import-outline {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #2c3e50;
  background: transparent;
  border: 1px solid #aeb6bf;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

/* Hover */
.btn-import-outline:hover {
  background-color: #f4f6f7;
  border-color: #85929e;
  color: #1b2631;
}

/* Active click */
.btn-import-outline:active {
  background-color: #eaecee;
  border-color: #5d6d7e;
}

/* Optional: focus */
.btn-import-outline:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(133, 146, 158, 0.2);
}

#attachmentListWrap {
  margin-left: 20px;
  margin-top: 8px;   /* add this */
  font-size: 12px;
  line-height: 1.4;
}

#attachmentListWrap .muted {
  font-size: 12px;
  color: #777;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid #aeb6bf;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  padding: 2px 8px;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.modal-close-btn:hover {
  background-color: #f4f6f7;
  border-color: #85929e;
}

#docUploadModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

#docUploadModal .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

#docUploadModal .modal-close-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid #aeb6bf;
  border-radius: 4px;
  color: #2c3e50;
  font-size: 14px;
  line-height: 1;
  padding: 3px 8px;
  cursor: pointer;
}

#docUploadModal .modal-close-btn:hover {
  background-color: #f4f6f7;
  border-color: #85929e;
  color: #1b2631;
}

#docUploadModal .modal-body {
  padding: 18px 16px 22px;
}

#docUploadModal .modal-footer {
  padding: 14px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#docUploadModal #btnUploadAttachment {
  background: transparent;
  border: 1px solid #aeb6bf;
  color: #2c3e50;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

#docUploadModal #btnUploadAttachment:hover {
  background-color: #f4f6f7;
  border-color: #85929e;
  color: #1b2631;
}

.attachment-link {
  font-size: 13px;
  font-weight: 400;
  color: #2a5db0;
  text-decoration: underline;
}

.attachment-link:hover {
  color: #1d3f7a;
  text-decoration: underline;
}

.detail-card .value a.attachment-link {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #2a5db0 !important;
  text-decoration: underline !important;
}

.detail-card .value div {
  display: flex;
  gap: 6px;
}

.detail-card .value div strong {
  min-width: 50px; /* keeps alignment clean */
}

/* Selected listing Tags card */
.adv-cattle-page .detail-card .value .tag-line {
  display: flex !important;
  gap: 5px !important;
  align-items: baseline !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 400 !important;
  color: #444 !important;
  margin-bottom: 2px !important;
}

.adv-cattle-page .detail-card .value .tag-line strong {
  min-width: 42px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #203448 !important;
}

.adv-cattle-page .detail-card .value .tag-line span {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #444 !important;
}

.adv-cattle-page .detail-card .value div {
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
}

.adv-cattle-page .detail-card .value div strong {
  font-weight: 700 !important;
}

/* Vaccination list container */
.adv-cattle-page .vac-list {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

/* Each row */
.adv-cattle-page .vac-list .vac-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  margin-bottom: 4px;
  align-items: start;
}
/* Date column */
.adv-cattle-page .vac-list .vac-date {
  font-weight: normal;
  white-space: nowrap;
  color: #aaa;
}
/* Name column */
.adv-cattle-page .vac-list .vac-name {
  font-weight: 400;
}
/* Mobile fallback */
@media (max-width: 600px) {
  .adv-cattle-page .vac-list .vac-row {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
}

/* Marketing layout cleanup */
.adv-cattle-page .marketing-box .info-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  column-gap: 10px;
  margin-bottom: 6px;
  align-items: start;
}

/* Labels */
.adv-cattle-page .marketing-box .info-row .k {
  font-weight: 600;
  font-size: 13px;
  color: #555;
}

/* Values */
.adv-cattle-page .marketing-box .info-row [data-bind] {
  font-weight: 400;
  font-size: 13px;
  color: #111;
}

/* Mobile: stack cleanly */
@media (max-width: 600px) {
  .adv-cattle-page .marketing-box .info-row {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }

  .adv-cattle-page .marketing-box .info-row .k {
    font-size: 12px;
  }
}

.sort-dropdown {
  width: auto !important;        /* <-- THIS is the fix */
  display: inline-block;
  padding: 6px 28px 6px 12px;
  border-radius: 18px;
  border: 1px solid #d0d5db;
  background: #f9fafb;
  font-size: 14px;
  color: #333;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.sort-dropdown:hover {
  border-color: #b8c0cc;
  background: #f3f4f6;
}

.sort-row select {
  width: auto !important;
}

.switch-row {
  margin-bottom: 18px;
  padding-top: 4px;
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: #f3f6f9;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
}

.mode-switch .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #294866;
  background: transparent;
  border: 1px solid transparent;
  transition: all .18s ease;
}

.mode-switch .pill:hover {
  background: #ffffff;
  border-color: #c8d6e3;
  color: #183b5b;
}

.mode-switch .pill.active {
  background:#8B4513;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(36, 79, 125, .18);
}

.selected-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eef1f4;
  color: #465260;
}

.selected-pill.is-selected {
  background: #dff3e6;
  color: #146c43;
  border: 1px solid #b9e2c7;
}

.contact-info-box {
  font-size: 12px;
  line-height: 1.4;
}

.contact-info-box a {
  font-size: 12px;
  text-decoration: underline;
}

.contact-info-box {
  word-break: break-word;
}

.lot-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
}

.lot-summary-grid div {
  font-size: 13px;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .lot-summary-grid {
    grid-template-columns: 1fr;
  }
}

.adv-cattle-page .feeder-listing-card .listing-body {
  grid-column: 2 / 5;
}

.adv-cattle-page .feeder-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 22px;
  margin-top: 8px;
}

.adv-cattle-page .feeder-card-col div {
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 3px;
}

.adv-cattle-page .listing-title-row {
  margin-bottom: 6px;
}

.adv-cattle-page .listing-title {
  margin: 0 0 4px;
}

@media (max-width: 1180px) {
  .adv-cattle-page .feeder-listing-card .listing-body {
    grid-column: auto;
  }

  .adv-cattle-page .feeder-card-grid {
    grid-template-columns: 1fr;
  }
}

.adv-cattle-page .listing-card .feeder-card-grid {
  border-top: 1px solid #e3e7ec !important;
  border-bottom: 1px solid #e3e7ec !important;
  padding: 5px 0 !important;   /* ← this is your spacing */
}

.adv-cattle-page .listing-card:hover,
.adv-cattle-page .listing-card.active:hover {
  border: 1px solid #8B4513 !important;
}

.adv-cattle-page .listing-card.feeder-listing-card .feeder-card-grid {
  border-top: 1px solid #e3e7ec !important;
  border-bottom: 1px solid #e3e7ec !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

.form-subvalue {
  margin-top: 4px;
  padding-left: 10px;
  font-size: 12px;
  color: #6b7280;
}

/* Row 1 — title left, tabs right */
.search-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title-text {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Row 3 — all on one flex line */
.filter-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  row-gap: 8px;
}

.filter-chips-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Pipe separator */
.filter-chips-pipe {
  width: 1px;
  height: 22px;
  background: #999;
  margin: 0 6px;
  flex-shrink: 0;
}

.filter-chips-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Pushes AI toggle to far right */
.filter-chips-spacer {
  flex: 1 0 auto;
  min-width: 0;
}

/* Prevent chip text from wrapping */
.filter-chip {
  white-space: nowrap;
}

/* AI toggle — keep your existing .ai-mode-toggle styles */
.ai-mode-toggle {
  flex-shrink: 0;
}

#aiResultsPanel {
  margin-top: 12px;
  border-radius: 12px;
  border: 1.5px solid #e8d5c4;
  background: #fff;
  overflow: hidden;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-answer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fdf6f0;
  border-bottom: 1px solid #e8d5c4;
  font-weight: 500;
  color: #8B4513;
}

#aiAnswerSource {
  margin-left: auto;
  font-size: 11px;
  color: #999;
  font-weight: 400;
}

#aiAnswerText {
  padding: 16px;
  line-height: 1.7;
  color: #333;
  font-size: 15px;
}

.ai-results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fdf6f0;
  border-bottom: 1px solid #e8d5c4;
  font-size: 13px;
  color: #666;
}

#aiResultsCount {
  font-weight: 600;
  color: #8B4513;
}

#aiResultsInterp {
  font-style: italic;
}

.ai-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.ai-close-btn:hover { background: #f0e6de; color: #8B4513; }

#aiListingCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 16px;
}

.ai-listing-card {
  border: 1px solid #e8d5c4;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.ai-listing-card:hover {
  box-shadow: 0 4px 16px rgba(139,69,19,0.12);
  border-color: #8B4513;
}

.ai-card-headline {
  font-weight: 600;
  color: #8B4513;
  margin-bottom: 6px;
  font-size: 14px;
}

.ai-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.ai-card-tag {
  background: #fdf6f0;
  border: 1px solid #e8d5c4;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  color: #8B4513;
}

.ai-card-distance {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.ai-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f0e6de;
  font-size: 12px;
  color: #888;
}

#aiNoResults {
  padding: 32px;
  text-align: center;
  color: #888;
}

#aiNoResults i {
  font-size: 32px;
  color: #e8d5c4;
  display: block;
  margin-bottom: 8px;
}

.ai-loading {
  padding: 24px;
  text-align: center;
  color: #8B4513;
  font-style: italic;
}

.ai-loading i {
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.corner-badge-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.listing-id-badge {
  font-size: 10px;
  color: #999;
}

.listing-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 240px;
  width: 100%;
}

.lmi-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ecdfd2;
  border-top-color: #8a4a23;
  border-radius: 50%;
  animation: lmi-spin 0.7s linear infinite;
}

.listing-loading-text {
  font-size: 14px;
  color: #8a8a8a;
  letter-spacing: 0.2px;
}

@keyframes lmi-spin {
  to { transform: rotate(360deg); }
}