:root {
  --cream: #f5f2ea;
  --forest: #183f24;
  --forest-2: #2c5319;
  --panel: #ffffff;
  --card: #f8fafc;
  --ink: #0f172a;
  --muted: #667085;
  --line: #e9edf2;
  --green: #047857;
  --green-soft: #ecfdf3;
  --yellow-soft: #fff7bd;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.protocol-warning {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  padding: 12px 18px;
  font-weight: 800;
  text-align: center;
}

.protocol-warning a {
  border-radius: 999px;
  background: #9a3412;
  color: white;
  padding: 7px 12px;
  text-decoration: none;
}

.hero {
  min-height: 230px;
  padding: 24px 40px 88px;
  color: white;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(120deg, var(--forest), var(--forest-2));
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto 22px;
}

.hero h1 {
  margin: 10px 0 10px;
  font-size: clamp(40px, 7vw, 82px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy,
.saved-count {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
}

.saved-count {
  margin-top: 14px;
  font-weight: 700;
}

.hero-kicker {
  color: rgba(255, 255, 255, 0.84);
}

.logo-mark {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 38px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav a,
.nav button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: 160ms ease;
}

.nav a:hover,
.nav button:hover {
  background: white;
  color: #064e3b;
}

.shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: -64px auto 48px;
  padding: 0 40px;
}

.panel {
  min-height: 420px;
  border-radius: 28px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: 1 / -1;
  min-height: auto;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #126b50;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stock-total {
  margin: 8px 0 0;
  color: #175c43;
  font-size: 15px;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
}

.table-dialog {
  width: min(1180px, calc(100vw - 28px));
}

.table-dialog-card {
  max-height: min(82vh, 820px);
  overflow: auto;
}

.animal-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.animal-table th,
.animal-table td {
  border-bottom: 1px solid #e4e9f0;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.animal-table th {
  color: #475467;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.animal-table input,
.animal-table select {
  min-width: 110px;
  border-radius: 10px;
  padding: 8px;
}

.animal-table .table-open {
  padding: 8px 12px;
}

.empty-cell {
  color: #667085;
  font-weight: 800;
  text-align: center;
}

.stock-card,
.paddock-card,
.job-card,
.event-card,
.finance-row {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: inherit;
}

.stock-card {
  min-height: 180px;
  padding: 16px;
  text-align: left;
  transition: 160ms ease;
}

.stock-card:hover,
.paddock-card:hover {
  background: #ecfdf5;
}

.stock-top,
.record-row,
.finance-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  font: inherit;
  text-align: left;
}

button.finance-row,
button.finance-summary {
  cursor: pointer;
}

.finance-amount {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.stock-card p,
.paddock-card p,
.job-card p,
.event-card p {
  margin-bottom: 0;
  color: #475467;
}

.badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--green-soft);
  color: #067647;
  font-size: 12px;
  font-weight: 900;
}

.badge.watch,
.badge.due {
  background: var(--yellow-soft);
  color: #854d0e;
}

.stock-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 10px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.age-line {
  margin-bottom: 16px;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.warning-line,
.table-warning {
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
}

.warning-message {
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  padding: 14px;
  font-weight: 800;
}

.primary-action.danger {
  background: #b42318;
}

.table-warning {
  display: block;
  margin-top: 6px;
}

.value {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
}

.pasture-summary,
.finance-summary {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid #d7f6e4;
  border-radius: 22px;
  background: #ecfdf3;
  padding: 18px;
  color: #175c43;
  text-align: left;
}

.summary-link {
  justify-self: start;
  width: fit-content;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: #175c43;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

.pasture-summary strong,
.finance-summary strong {
  font-size: 32px;
  line-height: 1;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.paddock-card,
.job-card,
.event-card,
.finance-row {
  padding: 16px;
}

.paddock-card {
  width: 100%;
  text-align: left;
}

.herd-location-card {
  background: #f8fafc;
}

.empty-state {
  display: grid;
  gap: 12px;
  place-items: start;
  border: 1px dashed #bdd7ca;
  border-radius: 18px;
  background: #f8fafc;
  padding: 18px;
}

.empty-state p {
  margin-bottom: 0;
  color: #667085;
  font-weight: 800;
}

.paddock-herds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.paddock-herds span {
  border-radius: 999px;
  background: #ecfdf3;
  color: #175c43;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.record-row strong {
  display: block;
}

.record-row small {
  display: block;
  color: #667085;
  font-weight: 800;
  text-align: right;
}

.job-card,
.event-card {
  background: #fff8e7;
}

.job-card.done {
  background: #f8fafc;
  opacity: 0.68;
}

.job-card .primary-action {
  margin-top: 12px;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.job-actions .primary-action {
  margin-top: 0;
}

.job-note {
  margin-top: 10px;
  font-size: 13px;
}

.compact {
  gap: 8px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.quick-actions button,
.primary-action,
.secondary-action {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
}

.quick-actions button,
.primary-action {
  background: #ecfdf3;
  color: #065f46;
  box-shadow: inset 0 0 0 1px #ccefdc;
}

.secondary-action {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 0 0 0 1px #d9e0ea;
}

.quiet {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b42318;
  font-weight: 900;
}

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

.hidden {
  display: none;
}

.dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-card {
  border-radius: 28px;
  background: white;
  padding: 24px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.dialog-card.small {
  max-width: 520px;
  margin: auto;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475467;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.birth-records {
  margin-top: 18px;
  border: 1px solid #e4e9f0;
  border-radius: 20px;
  background: #fbfcfe;
  padding: 16px;
}

.bulk-preview {
  margin: 16px 0 0;
  border-radius: 16px;
  background: #ecfdf3;
  color: #175c43;
  padding: 12px 14px;
  font-weight: 900;
}

.movement-summary {
  margin-top: 16px;
  border-radius: 16px;
  background: #f8fafc;
  color: #475467;
  padding: 12px 14px;
  font-weight: 900;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.choice-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choice-buttons button {
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  background: #fbfcfe;
  color: #344054;
  padding: 12px;
  font-weight: 900;
}

.choice-buttons button.selected {
  border-color: #34d399;
  background: #ecfdf3;
  color: #175c43;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.check-row input {
  width: auto;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion-chips button,
.suggestion-chips span {
  border: 0;
  border-radius: 999px;
  background: #ecfdf3;
  color: #175c43;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.suggestion-chips span {
  background: #f8fafc;
  color: #667085;
}

.birth-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.birth-heading h3,
.birth-heading p {
  margin-bottom: 0;
}

.birth-heading p {
  color: #475467;
  font-weight: 900;
}

.birth-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.treatment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.birth-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.birth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  background: white;
  padding: 10px 12px;
  box-shadow: inset 0 0 0 1px #e4e9f0;
}

.treatment-row {
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto;
}

.treatment-note {
  margin: -4px 0 4px 12px;
  color: #667085;
  font-size: 13px;
}

.birth-row button {
  border: 0;
  background: transparent;
  color: #b42318;
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.field-hint {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.field-hint.error {
  color: #b42318;
}

.full,
label.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  border-radius: 999px;
  background: #0f172a;
  color: white;
  padding: 12px 16px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .hero {
    padding: 22px 18px 72px;
  }

  .hero-inner {
    gap: 18px;
  }

  .shell {
    grid-template-columns: 1fr;
    margin-top: -52px;
    padding: 0 14px 32px;
  }

  .panel {
    min-height: auto;
    border-radius: 24px;
    padding: 20px;
  }

  .stock-grid,
  .form-grid,
  .checkbox-list,
  .choice-buttons {
    grid-template-columns: 1fr;
  }

  .birth-inputs,
  .treatment-grid,
  .birth-row {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .logo-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 30px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
