:root {
  --red: #8b0000;
  --red-dark: #650000;
  --red-soft: #f7eeee;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 14px 35px rgba(0, 0, 0, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.appHeader {
  height: 72px;
  background: linear-gradient(135deg, var(--red), #b00000);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 800;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.appHeader h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
}

.iconButton {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 28px;
  cursor: pointer;
}

#menuOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

#menuOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

.sideMenu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(82vw, 340px);
  height: 100vh;
  background: linear-gradient(160deg, #b00000, var(--red-dark));
  color: white;
  z-index: 1000;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  box-shadow: 18px 0 45px rgba(0, 0, 0, 0.28);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.sideMenu.open {
  transform: translateX(0);
}

.menuTop {
  position: relative;
  padding: 32px 4px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.closeButton {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: white;
  font-size: 42px;
  cursor: pointer;
}

.menuTop h2 {
  margin: 12px 0 6px;
  font-size: 30px;
}

.menuTop p {
  margin: 0;
  font-size: 18px;
  opacity: 0.85;
}

.menuLinks {
  margin-top: 24px;
}

.navBtn {
  width: 100%;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: left;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.navBtn.active {
  background: rgba(255, 255, 255, 0.20);
  box-shadow: inset 5px 0 0 white;
}

.logoutBtn {
  margin-top: auto;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.versionText {
  text-align: center;
  opacity: 0.75;
  margin-top: 22px;
}

.appMain {
  width: min(100%, 950px);
  margin: 0 auto;
  padding: 20px;
}

.hidden {
  display: none !important;
}

.heroCard {
  margin-top: 22px;
  min-height: calc(100vh - 140px);
  border-radius: 26px;
  background: white;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.heroCard h2 {
  margin: 8px 0;
  font-size: 42px;
}

.heroCard p,
.mutedText {
  color: var(--muted);
  font-size: 17px;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 13px;
}

.pageTitle {
  margin: 12px 0 18px;
}

.pageTitle h2 {
  margin: 4px 0 0;
  font-size: 34px;
}

.card,
.jobCard {
  background: var(--card);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card h3,
.jobCard h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.jobsTop {
  margin-bottom: 18px;
}

.jobsList {
  display: grid;
  gap: 14px;
}

.jobCard {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.jobCard:active {
  transform: scale(0.98);
}

.jobCardTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.jobBadge {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.jobMeta {
  color: var(--muted);
  margin: 8px 0 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 17px;
  background: #fbfbfb;
}

textarea {
  min-height: 110px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(139, 0, 0, 0.16);
  border-color: var(--red);
  background: white;
}

.primaryBtn,
.secondaryBtn,
.editBtn,
.deleteBtn {
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.primaryBtn,
.editBtn {
  background: var(--red);
  color: white;
  border: none;
}

.secondaryBtn {
  background: transparent;
  color: var(--red);
  border: 2px dashed var(--red);
}

.deleteBtn {
  background: #3f3f46;
  color: white;
  border: none;
}

.formSection {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.formSection h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.fieldLabel {
  margin: 14px 0 0;
  font-weight: 800;
  color: var(--text);
}

.segmentedGroup {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 10px;
}

.segmentBtn {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8f8f8;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.segmentBtn.selected {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.animalList {
  display: grid;
  gap: 12px;
}

.animalCard {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fbfbfb;
}

.animalCard strong {
  color: var(--red);
}

.animalActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.recordTimestamp {
  margin-top: 10px;
  font-size: 13px;
  color: #777;
}

.statusCard {
  background: var(--red-soft);
  border: 1px solid rgba(139, 0, 0, 0.16);
  color: var(--red);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-weight: 800;
}

.statusCard p {
  margin: 0;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}

.modalSheet {

  width: min(100%, 560px);

  max-height: 90vh;

  overflow-y: auto;

  background: white;

  border-radius: 28px 28px 22px 22px;

  padding: 18px;

  box-shadow: var(--shadow);

  animation: sheetUp 0.2s ease;

}

.modalHandle {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: #d1d5db;
  margin: 0 auto 14px;
}

.modalSheet h2 {
  margin: 0 0 12px;
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 750px) {
  .appHeader {
    height: 80px;
  }

  .appHeader h1 {
    font-size: 32px;
  }

  .appMain {
    padding: 28px;
  }

  .jobsList {
    grid-template-columns: repeat(2, 1fr);
  }

  .modalOverlay {
    align-items: center;
  }

  .modalSheet {
    border-radius: 28px;
  }
}

.recordsCompactList {

  display: grid;

  gap: 10px;

}


.recordRow {

  background: white;

  border-radius: 18px;

  padding: 16px;

  box-shadow: var(--shadow);

  border: 1px solid rgba(0,0,0,0.05);

}


.recordTop {

  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 12px;

}


.recordTitle {

  font-size: 22px;

  font-weight: 800;

  color: var(--red);

}


.recordGrid {

  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 10px;

  margin-top: 14px;

}


.recordItem {

  background: #f8f8f8;

  border-radius: 12px;

  padding: 10px;

}


.recordItemLabel {

  font-size: 12px;

  font-weight: 800;

  color: #777;

  text-transform: uppercase;

}


.recordItemValue {

  margin-top: 4px;

  font-size: 16px;

  font-weight: 700;

}


.recordBottom {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-top: 16px;

  gap: 10px;

}


.recordButtons {

  display: flex;

  gap: 10px;

}


.smallBtn {

  min-height: 42px;

  padding: 0 18px;

  border-radius: 12px;

  border: none;

  font-weight: 800;

  cursor: pointer;

}


.smallEditBtn {

  background: var(--red);

  color: white;

}


.smallDeleteBtn {

  background: #444;

  color: white;

}


.jobDeleteBtn {

  margin-top: 14px;

  background: #444;

  color: white;

}


#editFieldsContainer {

  display: grid;

  gap: 12px;

}