﻿:root {
  --bg: #f4efe8;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --line: rgba(82, 55, 32, 0.16);
  --line-strong: rgba(82, 55, 32, 0.24);
  --text: #22170f;
  --muted: #72604f;
  --accent: #cf6f2a;
  --accent-deep: #8d4216;
  --accent-soft: #f8d8b7;
  --mint: #d9f0ea;
  --sand: #fff0c5;
  --gray: #ebe5dc;
  --red-soft: #f9d8d1;
  --green: #226b4d;
  --yellow: #a77710;
  --red: #a64032;
  --shadow: none;
  --radius-xl: 0;
  --radius-lg: 0;
  --radius-md: 0;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--text);
  font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
  background: #f8f5ef;
}

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

.page-glow { display: none; }

.app-shell {
  position: relative;
  max-width: 1560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 28px 228px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  padding: 28px;
}

.auth-panel h1 {
  margin: 8px 0 10px;
  font-size: 2rem;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--red);
}

.hero,
.panel-card,
.summary-panel,
.table-panel,
.calendar-detail,
.profile-panel,
.setting-card,
.modal-card,
.calendar-day {
  border: 1px solid var(--line);
  box-shadow: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(700px, 0.98fr);
  gap: 12px;
  padding: 8px 10px 6px;
  border-radius: 0;
  background: #fff;
  margin-bottom: 4px;
  align-items: center;
}

.hero-copy h1,
.section-head h2,
.setting-card h3,
.profile-panel h3 {
  margin: 4px 0 0;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(1.04rem, 1.5vw, 1.55rem);
  line-height: 1;
}

.hero-copy {
  display: grid;
  align-content: center;
  min-height: 74px;
}

.title-button {
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-align: left;
}

.eyebrow {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta,
.help-text {
  color: var(--muted);
}

.hero-meta {
  margin: 4px 0 0;
  font-size: 0.74rem;
}

.hero-console-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 2px;
}

.hero-farm-switch {
  display: grid;
  gap: 4px;
  min-width: 196px;
}

.hero-farm-switch span {
  font-size: 0.74rem;
  color: var(--muted);
}

.hero-farm-switch select {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 9px;
}

.hero-actions,
.header-actions,
.modal-actions,
.status-filter,
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-actions { display: none; }

.action-button-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-icon {
  font-size: 0.9em;
  line-height: 1;
}

.hero-side {
  display: grid;
  align-items: center;
  justify-items: end;
  min-width: 0;
  width: 100%;
  gap: 0;
}

.hero-logout-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
}

.farm-badge,
.hero-stats,
.hero-stat {
  display: none !important;
}

.main-content {
  display: grid;
  gap: 12px;
}

.screen {
  display: none;
  gap: 24px;
}

.screen.active { display: grid; }

#screen-farms {
  gap: 10px;
}

.farm-hub-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 418px;
  gap: 6px;
  align-items: stretch;
}

.farm-hub-grid {
  display: block;
}

.farm-hub-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 6px;
}

.farm-hub-toolbar input {
  width: min(304px, 100%);
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

.farm-hub-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.farm-hub-summary-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 8px;
  display: grid;
  gap: 1px;
}

.farm-hub-summary-card span {
  font-size: 0.72rem;
  color: var(--muted);
}

.farm-hub-summary-card strong {
  font-size: 0.96rem;
}

.farm-hub-table-wrap {
  overflow: auto;
}

.farm-hub-table-wrap table {
  min-width: 1260px;
  table-layout: fixed;
}

.farm-hub-table th {
  background: rgba(34, 23, 15, 0.03);
  font-size: 0.78rem;
  white-space: nowrap;
}

.farm-hub-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 0.86rem;
}

.farm-hub-table th,
.farm-hub-table td {
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.farm-hub-table th:nth-child(1),
.farm-hub-table td:nth-child(1) {
  width: 170px;
}

.farm-hub-table th:nth-child(2),
.farm-hub-table td:nth-child(2) {
  width: 150px;
}

.farm-hub-table th:nth-child(3),
.farm-hub-table td:nth-child(3),
.farm-hub-table th:nth-child(4),
.farm-hub-table td:nth-child(4),
.farm-hub-table th:nth-child(5),
.farm-hub-table td:nth-child(5),
.farm-hub-table th:nth-child(8),
.farm-hub-table td:nth-child(8),
.farm-hub-table th:nth-child(9),
.farm-hub-table td:nth-child(9) {
  width: 92px;
}

.farm-hub-table th:nth-child(6),
.farm-hub-table td:nth-child(6) {
  width: 136px;
}

.farm-hub-table th:nth-child(7),
.farm-hub-table td:nth-child(7) {
  width: 160px;
}

.farm-hub-table th:nth-child(10),
.farm-hub-table td:nth-child(10) {
  width: 132px;
}

.farm-hub-table td:nth-child(3),
.farm-hub-table td:nth-child(4),
.farm-hub-table td:nth-child(5),
.farm-hub-table td:nth-child(6),
.farm-hub-table td:nth-child(8),
.farm-hub-table td:nth-child(9) {
  text-align: center;
  vertical-align: middle;
}

.farm-hub-table tbody tr.is-current-farm td {
  background: rgba(248, 216, 183, 0.12);
}

.farm-hub-table td strong {
  display: block;
  font-size: 0.96rem;
  margin-bottom: 2px;
}

.farm-hub-table td .help-text {
  margin-top: 2px;
  font-size: 0.74rem;
}

.farm-hub-empty {
  text-align: center !important;
  color: var(--muted);
  padding: 18px 12px !important;
}

.farm-hub-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.farm-hub-alert {
  padding: 3px 6px;
  border: 1px solid rgba(166, 64, 50, 0.22);
  background: rgba(249, 216, 209, 0.45);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.farm-hub-alert.is-ok {
  border-color: rgba(34, 107, 77, 0.2);
  background: rgba(217, 240, 234, 0.55);
  color: var(--green);
}

.farm-hub-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 4px;
}

.farm-hub-user-list span {
  padding: 2px 6px;
  background: rgba(82, 55, 32, 0.06);
  font-size: 0.72rem;
  white-space: nowrap;
}

.farm-hub-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
}

.farm-hub-actions .ghost-button {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 0.76rem;
}

.daily-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.daily-quickbar {
  margin-bottom: 0;
}

.daily-quickstats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.daily-quickstats .summary-card {
  padding: 8px 9px;
  min-height: auto;
}

.daily-quickstats .summary-card strong {
  font-size: 0.96rem;
  margin-top: 2px;
}

.daily-time-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: transparent;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(var(--slot-columns, 4), minmax(0, 1fr));
    gap: 6px 10px;
    margin-bottom: 0;
    align-items: stretch;
  }

.slot-row {
  display: grid;
  grid-template-columns: 92px minmax(132px, 1fr) 156px;
  border-top: 2px solid rgba(34, 23, 15, 0.9);
  border-bottom: 2px solid rgba(34, 23, 15, 0.9);
  min-width: 0;
  background: #fff;
}

.slot-row-label,
.slot-row-amount,
.slot-row-time {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 46px;
  padding: 2px 6px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.slot-row-time {
  border-right: none;
  justify-items: center;
}

.slot-row-label {
  font-size: 0.8rem;
  background: rgba(34, 23, 15, 0.03);
  word-break: keep-all;
  white-space: nowrap;
}

.slot-row-amount {
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
  }
  
.slot-row-time input {
      text-align: center;
      min-width: 0;
    min-height: 24px;
    padding: 0 28px 0 8px;
    width: 124px;
    max-width: calc(100% - 8px);
    box-sizing: border-box;
    font-size: 0.92rem;
    border: none;
    background: transparent;
  }

.slot-board-side,
.slot-board-side-cell {
  display: none !important;
}

.daily-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}

.feed-time-item {
  display: grid;
  gap: 4px;
}

.feed-time-item span {
  font-size: 0.74rem;
  color: var(--muted);
}

.daily-sidebar,
.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-toolbar {
      display: grid;
      gap: 6px;
      margin: 0;
    }

.settings-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.segmented-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.summary-panel,
.panel-card,
.table-panel,
.calendar-detail,
.profile-panel,
.setting-card,
.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.table-head h2 {
  font-size: 1rem;
}

.table-head .eyebrow {
  font-size: 0.72rem;
}

.setting-card.is-hidden {
  display: none;
}

#screen-settings {
  gap: 8px;
}

.settings-screen-intro {
    align-items: center;
    padding: 0 2px;
    min-height: 0;
    justify-content: flex-end;
  }

.settings-toolbar .help-text {
      margin: 0;
      font-size: 0.82rem;
    }

[data-settings-panel="farm"] .eyebrow {
  margin-bottom: 2px;
}

[data-settings-panel="farm"] h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

[data-settings-panel="farm"] label {
  gap: 4px;
}

.data-transfer-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.data-transfer-head {
  align-items: end;
}

.data-transfer-head h3 {
  margin: 0;
  font-size: 1rem;
}

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

.data-transfer-block {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.data-transfer-block strong {
  font-size: 0.92rem;
}

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

.data-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-transfer-actions .ghost-button {
  min-height: 34px;
  padding: 6px 12px;
}

.user-role-select,
.user-status-select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  font: inherit;
}

.user-inline-button {
  width: 100%;
  padding: 8px 10px;
}

.settings-note-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.settings-note-title {
  margin: 0 0 2px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.settings-note-block .help-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.section-head,
.screen-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.screen-intro {
  padding: 0 2px;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
}

.calendar-nav,
.calendar-jump {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-nav strong {
  min-width: 120px;
  text-align: center;
  font-size: 0.98rem;
}

.calendar-nav {
  grid-column: 2;
  justify-self: center;
}

.calendar-jump {
  justify-self: end;
}

#calendarTodayButton {
  white-space: nowrap;
  min-width: 42px;
  padding-inline: 8px;
}

.summary-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 0;
  align-self: center;
  align-items: stretch;
  width: min(100%, 860px);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: none;
  width: 100%;
  height: 100%;
}

.summary-strip-host {
  display: block;
  width: 100%;
}

.summary-strip-cell {
  display: grid;
  gap: 2px;
  align-content: center;
  justify-items: center;
  text-align: center;
  min-height: 46px;
  padding: 2px 4px;
  border-right: 1px solid var(--line-strong);
  border-top: 2px solid rgba(34, 23, 15, 0.9);
  border-bottom: 2px solid rgba(34, 23, 15, 0.9);
}

.summary-strip-cell:last-child {
  border-right: none;
}

.summary-strip-cell span {
  font-size: 0.68rem;
  white-space: nowrap;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.summary-strip-cell strong {
  font-size: 0.98rem;
  line-height: 1.05;
  white-space: nowrap;
}

.summary-logout-button {
  min-height: 46px;
  border-top: 2px solid rgba(34, 23, 15, 0.9);
  border-bottom: 2px solid rgba(34, 23, 15, 0.9);
  border-left: 1px solid var(--line-strong);
  background: #f4ecdf;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.summary-memo-cell {
  gap: 6px;
}

.summary-memo-cell textarea {
  width: 100%;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  resize: none;
  background: #fff;
}

.summary-card,
.status-card {
  padding: 8px 9px;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--line);
}

.status-card {
  min-height: 64px;
  text-align: left;
}

.summary-card strong,
.status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 0.94rem;
}

.summary-card .help-text,
.status-card .help-text {
  margin-top: 4px;
  font-size: 0.7rem;
}

.focus-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.focus-panel {
  display: none;
}

.focus-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff8f0;
  border: 1px solid var(--line);
}

.focus-item strong { font-size: 0.98rem; }

.daily-note textarea,
.modal-form textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--text);
}

.daily-note textarea,
.modal-form textarea {
  min-height: 64px;
  padding: 6px 8px;
  margin-top: 2px;
  resize: vertical;
}

.daily-note textarea {
  height: 100%;
  min-height: 78px;
}

input,
select {
  padding: 7px 8px;
}

.table-head {
  margin-bottom: 2px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.table-head .eyebrow {
  display: none;
}

.table-head > div {
  display: grid;
  gap: 0;
  min-width: 0;
}

.table-head h2 {
  margin: 0;
  line-height: 1.05;
}

.daily-table-actions {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
  flex-wrap: nowrap;
}

.daily-table-actions .primary-button,
.daily-table-actions .ghost-button {
  min-height: 26px;
  padding: 2px 8px;
  font-size: 0.74rem;
  border: 1px solid rgba(82, 55, 32, 0.12);
  background: transparent;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.daily-table-actions .primary-button {
  color: var(--accent-deep);
  border-color: rgba(207, 111, 42, 0.38);
  background: rgba(248, 216, 183, 0.26);
}

.daily-table-actions .ghost-button {
  color: var(--text);
}

.legend-row { margin-bottom: 6px; gap: 6px; }

.legend-row { display: none; }

.daily-action-cell {
  text-align: center;
  vertical-align: middle;
  padding-left: 6px;
  padding-right: 6px;
}

.action-button-mini {
  min-width: 38px;
  padding: 3px 6px;
  font-size: 0.62rem;
  line-height: 1.1;
  border: 1px solid rgba(82, 55, 32, 0.12);
  background: transparent;
  white-space: nowrap;
}

.action-button-mini.is-alert {
  border-color: rgba(167, 119, 16, 0.35);
  color: var(--yellow);
}

.action-button-mini.is-done {
  border-color: rgba(34, 107, 77, 0.3);
  color: var(--green);
}

.action-button-mini.is-dead {
  border-color: rgba(166, 64, 50, 0.35);
  color: var(--red);
}

.action-text {
  display: inline-block;
  min-height: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 600;
}

.legend-chip.gray { background: var(--gray); }
.legend-chip.sand { background: var(--sand); }
.legend-chip.mint { background: var(--mint); }
.legend-chip.red { background: var(--red-soft); color: var(--red); }

.table-wrap {
  overflow: auto;
  border-radius: 0;
  border: 1px solid var(--line);
  border-top: 2px solid rgba(34, 23, 15, 0.9);
  background: #fff;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: fixed;
}

.daily-board table {
    min-width: 1140px;
    table-layout: fixed;
  }
  
.daily-board th,
.daily-board td {
    text-align: center;
    overflow: hidden;
    padding-top: 4px;
    padding-bottom: 4px;
  }

.daily-board tbody td {
  border-top: 1px solid rgba(82, 55, 32, 0.16);
}

.daily-board th:not(:last-child),
.daily-board td:not(:last-child) {
  border-right: 1px solid rgba(82, 55, 32, 0.16);
}

.daily-board th {
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(82, 55, 32, 0.16);
  background: rgba(34, 23, 15, 0.03);
}

.daily-board td {
  height: 40px;
}

.daily-board th:nth-child(1),
.daily-board td:nth-child(1) {
  width: 40px;
  background: rgba(34, 23, 15, 0.03);
}

.daily-board th:nth-child(2),
.daily-board td:nth-child(2) {
  width: 96px;
  background: rgba(34, 23, 15, 0.03);
}

.daily-board th:nth-child(3),
.daily-board td:nth-child(3),
.daily-board th:nth-child(4),
.daily-board td:nth-child(4) {
  width: 42px;
}

.daily-board th:nth-child(-n+4),
.daily-board td:nth-child(-n+4) {
  background: rgba(34, 23, 15, 0.03);
}


.daily-board th:nth-child(5),
.daily-board td:nth-child(5),
.daily-board th:nth-child(6),
.daily-board td:nth-child(6),
.daily-board th:nth-child(7),
.daily-board td:nth-child(7),
.daily-board th:nth-child(8),
.daily-board td:nth-child(8),
.daily-board th:nth-child(9),
.daily-board td:nth-child(9) {
  width: 110px;
}

.daily-board th:nth-last-child(4),
.daily-board td:nth-last-child(4) {
    width: auto;
  }

.daily-board th:nth-last-child(3),
.daily-board td:nth-last-child(3),
.daily-board th:nth-last-child(2),
.daily-board td:nth-last-child(2),
.daily-board th:last-child,
.daily-board td:last-child {
  width: 48px;
}

.calves-list-table {
  min-width: 1240px;
}

.annual-summary-wrap table {
  min-width: 980px !important;
  table-layout: fixed;
}

.annual-summary-wrap col {
  width: 12.5%;
}

.annual-summary-wrap th,
.annual-summary-wrap td {
  text-align: center;
  white-space: nowrap;
}

#screen-calves {
  gap: 8px;
}

#screen-calves .screen-intro {
    padding: 0;
    border-bottom: none;
    padding-bottom: 0;
}

#screen-calves .screen-intro h2 {
    font-size: 1.02rem;
    margin: 0;
}

#screen-calves .table-panel.compact {
    padding: 6px 8px;
  }

#screen-calves .section-head {
    align-items: center;
    padding: 0 2px 8px;
    border-bottom: 1px solid rgba(82, 55, 32, 0.16);
  }

.annual-summary-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.annual-summary-toggle {
  min-width: 24px;
  min-height: 24px;
  padding: 0 4px;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  line-height: 1;
}

.annual-summary-wrap.is-collapsed {
  display: none;
}

#screen-calves .primary-button {
  min-height: 28px;
  padding: 3px 12px;
  font-size: 0.76rem;
}

#screen-calves .status-filter {
  gap: 4px;
}

#screen-calves .status-filter .action-button {
  min-height: 28px;
  padding: 3px 12px;
  font-size: 0.78rem;
}

.annual-summary-total td {
  font-weight: 700;
  background: rgba(34, 23, 15, 0.04);
}

.annual-summary-wrap thead tr:first-child th {
  border-bottom: 1px solid rgba(82, 55, 32, 0.16);
  background: rgba(247, 242, 235, 0.72) !important;
}

.annual-summary-wrap thead tr:last-child th {
  background: rgba(247, 242, 235, 0.9) !important;
}

.annual-summary-wrap th {
  font-size: 0.78rem;
  padding: 6px 8px;
}

.annual-summary-wrap thead th {
  background: rgba(247, 242, 235, 0.9) !important;
  border-right: 1px solid rgba(82, 55, 32, 0.12);
}

.annual-summary-wrap tbody td {
  padding: 6px 8px;
  font-size: 0.88rem;
  border-right: 1px solid rgba(82, 55, 32, 0.12);
}

.annual-summary-wrap tr > *:last-child {
  border-right: none;
}

.annual-summary-wrap tbody td:nth-child(1) {
  background: rgba(247, 242, 235, 0.92) !important;
}

.annual-summary-wrap tbody td:nth-child(2),
.annual-summary-wrap tbody td:nth-child(3),
.annual-summary-wrap tbody td:nth-child(4),
.annual-summary-wrap tbody td:nth-child(5),
.annual-summary-wrap tbody td:nth-child(6),
.annual-summary-wrap tbody td:nth-child(7) {
  background: #fff !important;
}

.annual-summary-wrap tbody td:nth-child(8) {
  background: #fff !important;
}

.annual-summary-wrap tbody tr:last-child td {
  background: rgba(247, 242, 235, 0.98) !important;
  font-weight: 700;
}

.annual-summary-wrap tbody tr:last-child td {
  border-bottom: none;
}

.calves-list-table th:nth-child(1),
.calves-list-table td:nth-child(1) {
  width: 150px;
  white-space: nowrap;
  padding-left: 0;
  padding-right: 0;
}

.calves-list-table th:nth-child(2),
.calves-list-table td:nth-child(2) {
  width: 240px;
  white-space: nowrap;
}

.calves-list-table td:nth-child(1) .action-button,
.calves-list-table td:nth-child(2) .action-button {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 0;
    text-align: center;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    border: none;
    background: transparent;
    box-shadow: none;
}

.calves-list-table th:nth-child(3),
.calves-list-table td:nth-child(3) {
  width: 160px;
}

.calves-list-table th:nth-child(4),
.calves-list-table td:nth-child(4) {
  width: 72px;
  white-space: nowrap;
}

.calves-list-table th:nth-child(5),
.calves-list-table td:nth-child(5) {
  width: 92px;
  white-space: nowrap;
}

.calves-list-table th:nth-child(6),
.calves-list-table td:nth-child(6) {
  width: 240px;
  white-space: nowrap;
}

.calves-list-table th:nth-child(7),
.calves-list-table td:nth-child(7) {
  width: 120px;
  white-space: nowrap;
}

.calves-list-table th,
.calves-list-table td {
  text-align: center;
}

.calves-list-table th:first-child,
.calves-list-table td:first-child,
.calves-list-table th:nth-child(2),
.calves-list-table td:nth-child(2) {
  position: static;
  left: auto;
  z-index: auto;
  background: transparent;
}

#screen-calves .table-panel.compact > .table-wrap {
  border-top: none;
}

.annual-summary-wrap table thead th,
.calves-list-table thead th {
  font-size: 0.8rem;
}

.annual-summary-wrap table tbody td,
.calves-list-table tbody td {
  padding-top: 5px;
  padding-bottom: 5px;
}

#screen-stock .screen-intro,
#screen-stock #inventoryCards,
#screen-stock #stockRecordButton {
  display: none !important;
}

.stock-page {
  display: grid;
  gap: 14px;
}

.stock-block {
  border-top: 2px solid rgba(34, 23, 15, 0.95);
  border-bottom: 2px solid rgba(34, 23, 15, 0.95);
  padding: 0;
  background: #fff;
}

.stock-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 7px;
}

.stock-title-row h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.stock-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(82, 55, 32, 0.28);
  border-bottom: 1px solid rgba(82, 55, 32, 0.22);
}

.stock-summary-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stock-summary-cell {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 82px;
  padding: 10px 12px;
  border-right: 1px solid rgba(82, 55, 32, 0.22);
  text-align: center;
}

.stock-summary-cell:last-child {
  border-right: none;
}

.stock-summary-cell span {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
}

.stock-summary-cell strong {
  margin-top: 7px;
  font-size: 1.58rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.stock-entry-head {
  padding-bottom: 6px;
}

.stock-inline-wrap,
.stock-page .table-wrap {
  border-top: 1px solid rgba(82, 55, 32, 0.28);
}

#stockMonthlySummary + .table-wrap {
  margin-top: 0;
  border-top: none;
}

.stock-entry-table,
.stock-monthly-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.stock-entry-table th,
.stock-monthly-table th,
.stock-entry-table td,
.stock-monthly-table td {
  position: static;
  left: auto;
  z-index: auto;
  background: transparent;
}

.stock-entry-table th,
.stock-entry-table td,
.stock-monthly-table th,
.stock-monthly-table td {
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid rgba(82, 55, 32, 0.16);
}

.stock-entry-table th:last-child,
.stock-entry-table td:last-child,
.stock-monthly-table th:last-child,
.stock-monthly-table td:last-child {
  border-right: none;
}

.stock-entry-table th:nth-child(1),
.stock-entry-table td:nth-child(1),
.stock-monthly-table th:nth-child(1),
.stock-monthly-table td:nth-child(1) {
  width: 170px;
}

.stock-entry-table th:nth-child(2),
.stock-entry-table td:nth-child(2),
.stock-monthly-table th:nth-child(2),
.stock-monthly-table td:nth-child(2) {
  width: 140px;
}

.stock-entry-table th:nth-child(3),
.stock-entry-table td:nth-child(3),
.stock-entry-table th:nth-child(4),
.stock-entry-table td:nth-child(4),
.stock-entry-table th:nth-child(5),
.stock-entry-table td:nth-child(5),
.stock-monthly-table th:nth-child(3),
.stock-monthly-table td:nth-child(3),
.stock-monthly-table th:nth-child(4),
.stock-monthly-table td:nth-child(4),
.stock-monthly-table th:nth-child(5),
.stock-monthly-table td:nth-child(5) {
  width: 150px;
}

.stock-entry-table th:nth-child(6),
.stock-entry-table td:nth-child(6),
.stock-monthly-table th:nth-child(6),
.stock-monthly-table td:nth-child(6) {
  width: auto;
}

.stock-entry-table input,
.stock-entry-table select {
  width: 100%;
  min-height: 40px;
  border: none;
  background: transparent;
  text-align: center;
  padding: 0 8px;
  font-size: 0.94rem;
}

.stock-entry-table input[readonly] {
  color: var(--muted);
}

.stock-entry-table input:disabled {
  color: rgba(114, 96, 79, 0.65);
  background: rgba(82, 55, 32, 0.04);
}

.stock-entry-table tbody td,
.stock-monthly-table tbody td {
  min-height: 50px;
}

.stock-month-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.stock-month-nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.stock-month-nav-center strong {
  font-size: 1.14rem;
  min-width: 132px;
  text-align: center;
  letter-spacing: -0.03em;
}

.stock-entry-table td:nth-child(3),
.stock-entry-table td:nth-child(4),
.stock-entry-table td:nth-child(5),
.stock-monthly-table td:nth-child(3),
.stock-monthly-table td:nth-child(4),
.stock-monthly-table td:nth-child(5) {
  text-align: right;
}

.stock-entry-table td:nth-child(6),
.stock-monthly-table td:nth-child(6) {
  text-align: left;
  padding-left: 10px;
}

.stock-entry-table tbody tr:nth-child(odd),
.stock-monthly-table tbody tr:nth-child(odd) {
  background: rgba(255, 249, 242, 0.45);
}

.stock-entry-table tbody tr:hover,
.stock-monthly-table tbody tr:hover {
  background: rgba(248, 216, 183, 0.18);
}

.stock-row-in td:nth-child(2) {
  color: var(--green);
  font-weight: 700;
}

.stock-row-out td:nth-child(2) {
  color: var(--red);
  font-weight: 700;
}

th,
td {
  padding: 6px 6px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(82, 55, 32, 0.08);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(250, 242, 231, 0.98);
  font-size: 0.9rem;
}

.daily-board th:nth-child(1),
.daily-board td:nth-child(1) {
  width: 40px;
}

.daily-board th:nth-child(2),
.daily-board td:nth-child(2) {
  width: 96px;
}

.daily-board th:nth-child(3),
.daily-board td:nth-child(3) {
  width: 42px;
}

.daily-board td:first-child,
.daily-board th:first-child,
.daily-board td:nth-child(2),
.daily-board th:nth-child(2) {
  position: sticky;
  left: 0;
  background: rgba(255, 251, 246, 0.98);
  z-index: 2;
}

.daily-board td:nth-child(2),
.daily-board th:nth-child(2) {
  left: 40px;
}

.daily-board td:first-child,
.daily-board th:first-child,
.daily-board td:nth-child(2),
.daily-board th:nth-child(2),
.profile-summary-table td:first-child,
.profile-summary-table th:first-child,
.profile-summary-table td:nth-child(2),
.profile-summary-table th:nth-child(2),
.profile-history-table td:first-child,
.profile-history-table th:first-child,
.profile-history-table td:nth-child(2),
.profile-history-table th:nth-child(2) {
  position: static;
  left: auto;
  z-index: auto;
}

.daily-board td:nth-child(2) .action-button {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 5px;
  border: 1px solid rgba(82, 55, 32, 0.12);
  background: transparent;
  color: var(--text);
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
}

.daily-board td:nth-child(3),
.daily-board th:nth-child(3) {
  text-align: center;
}

.daily-board tbody tr:hover td {
  background: rgba(255, 251, 246, 0.55);
}

textarea[data-field="note"] {
  min-height: 30px;
  padding: 4px 6px;
}

.daily-board td input,
.daily-board td textarea {
    text-align: center;
    min-height: 28px;
    padding: 0 3px;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.86rem;
    border: none;
    background: transparent;
    box-shadow: none;
  }

.daily-board td:nth-child(2) .action-button,
.daily-board td:nth-child(2) .action-button:focus,
.daily-board td:nth-child(2) .action-button:hover {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: 100%;
  margin: 0;
  display: block;
  text-align: center;
  min-height: auto;
}

.daily-board td:nth-last-child(4) textarea {
    text-align: left;
    min-height: 28px;
    padding: 1px 5px;
    height: 28px;
    max-height: 28px;
    line-height: 26px;
    resize: none;
    overflow: hidden;
    white-space: nowrap;
    word-break: normal;
    text-overflow: ellipsis;
  }

.daily-col-index { width: 40px; }
.daily-col-management { width: 96px; }
.daily-col-age,
.daily-col-week { width: 42px; }
.daily-col-feed { width: 102px; }
.daily-col-starter { width: 96px; }
.daily-col-measure { width: 96px; }
.daily-col-note { width: auto; }
.daily-col-action { width: 56px; }

.hero-actions .primary-button,
.hero-actions .secondary-button,
.hero-actions .ghost-button,
.hero-actions .action-button {
  padding: 6px 10px;
  font-size: 0.84rem;
  min-height: 34px;
}

.predicted { background: var(--gray); color: #6c655b; }
.edited-feed { background: rgba(255,255,255,0.92); color: #8a2f2f; font-weight: 600; }
.measure-weight { background: var(--sand); }
.measure-height { background: var(--mint); }

.action-group {
  display: grid;
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.status-pill.green { color: var(--green); background: rgba(34, 107, 77, 0.12); }
.status-pill.yellow { color: var(--yellow); background: rgba(167, 119, 16, 0.14); }
.status-pill.red { color: var(--red); background: rgba(166, 64, 50, 0.14); }

.primary-button,
.secondary-button,
.ghost-button,
.action-button,
.nav-item,
.icon-button {
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.primary-button,
.secondary-button,
.ghost-button,
.action-button,
.nav-item {
  padding: 10px 14px;
  border-radius: 0;
}

.primary-button {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.secondary-button {
  background: #2f241c;
  color: #fff6ef;
}

.ghost-button,
.action-button,
.nav-item,
.icon-button {
  background: #efe4d6;
  color: var(--text);
}

.ghost-button.danger-button {
  background: #f7e4de;
  color: #9a3a25;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.action-button:hover,
.nav-item:hover,
.icon-button:hover {
  transform: none;
}

.action-button.active,
.nav-item.active {
  background: var(--accent);
  color: white;
}

.table-simple .detail-col {
  display: none;
}

.table-simple .action-button {
  min-height: 34px;
  font-weight: 700;
  padding: 6px 8px;
}

.table-card-mode .table-wrap {
  display: none;
}

.calendar-board {
  padding: 0;
  overflow: hidden;
  margin-top: -4px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: rgba(247, 242, 235, 0.98);
  border-bottom: 1px solid var(--line);
}

.calendar-weekday {
  padding: 12px 8px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: #384860;
  border-right: 1px solid var(--line);
}

.calendar-weekday:last-child {
  border-right: none;
}

.calendar-weekday.sunday {
  background: rgba(247, 225, 225, 0.45);
}

.calendar-weekday.saturday {
  background: rgba(223, 239, 249, 0.7);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}

.calendar-day {
  position: relative;
  padding: 12px;
  min-height: 176px;
  border-radius: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.calendar-day.outside {
  color: #95a0ad;
  background: #fbfbfb;
}

.calendar-day.today {
  background: #fffdf8;
}
.calendar-day.selected .date-number {
  color: #2f6df6;
  font-weight: 700;
}

.calendar-day.sunday {
  background: rgba(247, 225, 225, 0.2);
}

.calendar-day.saturday {
  background: rgba(223, 239, 249, 0.35);
}

.calendar-day-head {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0;
}

.calendar-day-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-number {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 400;
  color: #445061;
}

.calendar-day.today .date-number {
  background: transparent;
  color: #2f6df6;
  font-weight: 700;
}

.today-dot {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #2f6df6;
}

.calendar-events {
  display: grid;
  grid-template-rows: repeat(4, minmax(22px, auto));
  gap: 4px;
  margin-top: 34px;
}

.calendar-event {
  min-height: 22px;
  display: flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 0;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: pre-wrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid #a0a5ab;
}

.calendar-event.gray {
  background: transparent;
  color: #4f5660;
  border-left-color: #737980;
}

.calendar-event.soft {
    background: transparent;
    color: #6b7179;
    border-left-color: #b0b5bc;
  }

.calendar-event.status-draft {
    background: rgba(233, 184, 83, 0.14);
    color: #9a6811;
    border-left-color: #d8941f;
    font-weight: 700;
}

.calendar-event.status-complete {
    background: rgba(68, 156, 94, 0.14);
    color: #2f7a45;
    border-left-color: #3f9b5b;
    font-weight: 700;
}

.calendar-event.status-projected {
    background: rgba(93, 120, 168, 0.12);
    color: #496187;
    border-left-color: #6b86af;
    font-weight: 700;
}

.calendar-event.alert {
  background: transparent;
  color: #b24b4b;
  border-left-color: #b24b4b;
}

.calendar-event.line {
  background: transparent;
  color: #5f6670;
  border-left-color: #d0d5db;
}

.calendar-event.empty {
  border-left-color: transparent;
  color: transparent;
}

.calendar-note {
  font-size: 0.78rem;
  color: #7c8796;
  padding: 2px 2px 0;
}

.alert-text {
  margin-top: 10px;
  color: var(--red);
  font-weight: 700;
}

.profile-grid,
.hero-stats,
.settings-grid,
.feeding-matrix,
.legend-list {
  display: grid;
  gap: 14px;
}

.feeding-matrix {
  overflow-x: auto;
}

.feeding-plan-grid,
.legend-edit-grid {
  display: grid;
  gap: 10px;
}

.feeding-plan-row,
.legend-edit-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr 0.8fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.feeding-plan-row {
  grid-template-columns: 0.9fr 0.9fr 0.9fr 0.9fr repeat(8, 0.78fr) 0.9fr 0.95fr 92px;
  align-items: center;
  min-width: 1380px;
}

.feeding-plan-actions {
  display: flex;
  justify-content: flex-end;
}

.feeding-default-time-row {
  display: grid;
  grid-template-columns: 1.45fr repeat(8, 0.82fr);
  gap: 8px;
  align-items: end;
  min-width: 1080px;
  padding: 0 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.feeding-default-time-label {
  display: grid;
  gap: 4px;
}

.feeding-default-time-label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.feeding-default-time-item {
    display: grid;
    gap: 4px;
  }

.feeding-default-time-item span {
    font-size: 0.78rem;
    color: var(--muted);
  }

.inline-clear-button {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.76rem;
}

#measurementSettingsBody td {
    vertical-align: middle;
}

.feeding-plan-header {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 0.9fr 0.9fr repeat(8, 0.78fr) 0.9fr 0.95fr 92px;
  gap: 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  min-width: 1380px;
  align-items: end;
}

.feeding-plan-header span:last-child {
  text-align: right;
}

.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.profile-grid-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-box,
.legend-item {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
}

.profile-box span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.profile-box strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.45;
  color: #2d2d2d;
  word-break: keep-all;
}

.profile-box div {
  color: #555;
  line-height: 1.45;
}

.profile-panel { display: grid; gap: 18px; }
.profile-section {
  display: grid;
  gap: 10px;
}

.profile-section-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 2px 0 6px;
  border-bottom: 2px solid rgba(34, 23, 15, 0.9);
}

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

.profile-summary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
}

.profile-history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.profile-history-table th,
.profile-history-table td {
  position: static;
  left: auto;
  z-index: auto;
  background-clip: padding-box;
}

.profile-history-table-colostrum th,
.profile-history-table-colostrum td {
    width: 20%;
}

.profile-history-table-measure th,
.profile-history-table-measure td {
    width: 20%;
}

.profile-history-table-disease th,
.profile-history-table-disease td {
    width: 16.66%;
}

.profile-summary-table th,
.profile-summary-table td,
.profile-history-table th,
.profile-history-table td {
  border: 1px solid rgba(82, 55, 32, 0.18);
  padding: 9px 12px;
  vertical-align: middle;
}

.profile-summary-table th,
.profile-history-table th {
  background: rgba(247, 242, 235, 0.6) !important;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.profile-summary-table td {
  font-weight: 700;
  color: #2d2d2d;
  word-break: keep-all;
  white-space: nowrap;
  text-align: center;
}

.profile-summary-table .nowrap-cell {
  white-space: nowrap;
}

.profile-summary-table .address-cell {
  text-align: left;
  white-space: normal;
  line-height: 1.45;
}

.profile-history-table td {
  background: #fff !important;
  text-align: center;
  vertical-align: middle;
  line-height: 1.35;
}

.calves-list-table th,
.calves-list-table td {
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  text-align: center;
  border-right: 1px solid rgba(82, 55, 32, 0.12);
}

.calves-list-table td {
  background: #fff !important;
}

.calves-list-table thead th {
  background: rgba(247, 242, 235, 0.9) !important;
}

.calves-list-table th:first-child,
.calves-list-table td:first-child {
  width: 150px;
  padding-left: 6px;
  padding-right: 6px;
  background: rgba(34, 23, 15, 0.03) !important;
}

.calves-list-table th:nth-child(2),
.calves-list-table td:nth-child(2) {
  width: 240px;
}

.calves-list-table th:nth-child(3),
.calves-list-table td:nth-child(3) {
  width: 160px;
}

.calves-list-table th:nth-child(4),
.calves-list-table td:nth-child(4) {
  width: 72px;
}

.calves-list-table th:nth-child(5),
.calves-list-table td:nth-child(5) {
  width: 92px;
}

.calves-list-table th:nth-child(6),
.calves-list-table td:nth-child(6) {
  width: 240px;
  white-space: nowrap;
}

.calves-list-table th:nth-child(7),
.calves-list-table td:nth-child(7) {
  width: 120px;
  white-space: nowrap;
}

.calves-list-table th:first-child,
.calves-list-table td:first-child,
.calves-list-table th:nth-child(2),
.calves-list-table td:nth-child(2) {
  border-left: none;
}

.calves-list-table tr > *:last-child {
  border-right: none;
}

.calves-list-table td:first-child .action-button {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-weight: 400;
}

.profile-history-table td:last-child,
.profile-history-table th:last-child,
  .profile-summary-table td:last-child,
.profile-summary-table th:last-child {
  text-align: left;
}

.profile-history-table-colostrum td:last-child,
.profile-history-table-colostrum th:last-child,
.profile-history-table-measure td:last-child,
.profile-history-table-measure th:last-child,
.profile-history-table-disease td:last-child,
.profile-history-table-disease th:last-child {
  text-align: center;
}

.profile-section > .eyebrow {
  font-size: 0.76rem;
  color: #5e544b;
}

.profile-panel .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  border-bottom: 2px solid rgba(34, 23, 15, 0.9);
  padding-bottom: 6px;
}

.profile-panel .section-head h3 {
  font-size: 1.08rem;
}

.profile-panel .header-actions {
  justify-content: flex-end;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  align-self: end;
}

.profile-panel .action-button {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 0.8rem;
}

.graph {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  min-height: 140px;
  align-items: end;
}

.trend-chart {
  border: 1px solid var(--line);
  padding: 10px 12px 8px;
  background: #fff;
}

.trend-chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-line {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 3px solid currentColor;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-line-expected {
  color: #4a7bd6;
}

.legend-line-actual {
  color: #e18a32;
}

.trend-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.trend-gridline {
  stroke: rgba(82, 55, 32, 0.18);
  stroke-width: 1;
}

.trend-line {
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line-expected {
  stroke: #4a7bd6;
}

.trend-line-actual {
  stroke: #e18a32;
}

.trend-axis-label {
  font-size: 10px;
  fill: #6d6259;
}

.profile-history-table tr td[colspan] {
  text-align: center !important;
  color: #6b6159;
}

.profile-panel .profile-box {
  min-height: 72px;
}

.bar {
  border-radius: 0;
  background: #d8d8d8;
  color: #444;
  display: flex;
  align-items: end;
  justify-content: center;
  padding-bottom: 8px;
  font-size: 0.78rem;
}

.matrix-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.legend-item strong { display: block; margin-bottom: 6px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(24, 16, 10, 0.45);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-overlay.hidden { display: none; }

.modal-card {
  width: min(1120px, 100%);
  position: relative;
  z-index: 2001;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.modal-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.modal-form label { display: grid; gap: 8px; }
.modal-form label > span {
  font-size: 0.94rem;
  font-weight: 600;
}
.modal-form label em {
  color: #ff3b30;
  font-style: normal;
}
.modal-layout {
  display: grid;
  gap: 16px;
}
.modal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 16px 24px;
  align-items: start;
}

.calf-form-layout .modal-grid-2 > label {
  min-width: 0;
}
.modal-field-hint {
  margin-top: -6px;
  color: var(--muted);
  font-size: 0.86rem;
}
.modal-photo-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.modal-label {
  font-size: 0.96rem;
  font-weight: 600;
}
.modal-photo-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.modal-photo-actions .primary-button {
  min-width: 140px;
}
.hidden-file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.modal-note-list {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.modal-note-list li + li {
  margin-top: 6px;
}

.modal-info-block {
  min-width: 0;
}

.brix-guide {
  display: grid;
  gap: 8px;
}

.brix-guide-title {
  font-weight: 700;
}

.brix-guide-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.82rem;
}

.brix-guide-table th,
.brix-guide-table td {
  border: 1px solid rgba(82, 55, 32, 0.18);
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.25;
}

.brix-guide-table.compact th {
  background: rgba(34, 23, 15, 0.04);
  font-weight: 700;
}

.brix-guide-table.compact th:nth-child(1),
.brix-guide-table.compact td:nth-child(1) {
  width: 112px;
}

.brix-guide-table.compact th:nth-child(2),
.brix-guide-table.compact td:nth-child(2) {
  width: 124px;
}

.brix-guide-table.compact td:nth-child(3) {
  text-align: left;
}

.brix-guide-table.compact tr.brix-low td {
  background: rgba(255, 59, 48, 0.12);
  color: #9d231c;
}

.brix-guide-table.compact tr.brix-mid td {
  background: rgba(255, 242, 54, 0.28);
  color: #6f5a00;
}

.brix-guide-table.compact tr.brix-high td {
  background: rgba(155, 212, 90, 0.26);
  color: #3b5d12;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.modal-status {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(247, 242, 235, 0.72);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.modal-status.is-info {
  border-color: rgba(82, 55, 32, 0.18);
  background: rgba(247, 242, 235, 0.72);
}

.modal-status.is-busy {
  border-color: rgba(207, 111, 42, 0.26);
  background: rgba(248, 216, 183, 0.38);
}

.modal-status.is-success {
  border-color: rgba(34, 107, 77, 0.26);
  background: rgba(217, 240, 234, 0.68);
  color: var(--green);
}

.modal-status.is-error {
  border-color: rgba(166, 64, 50, 0.24);
  background: rgba(249, 216, 209, 0.78);
  color: var(--red);
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 0;
  font-size: 1.4rem;
}

.bottom-nav {
    position: sticky;
    left: auto;
    bottom: 14px;
    transform: none;
    width: min(calc(var(--bottom-nav-columns, 5) * 136px + 12px), calc(100% - 24px));
    margin: 18px auto 0;
    padding: 6px;
    border-radius: 0;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: none;
    display: grid;
    grid-template-columns: repeat(var(--bottom-nav-columns, 5), minmax(0, 1fr));
    gap: 6px;
    z-index: 20;
  }

#screen-daily,
#screen-calves,
#screen-settings,
.daily-layout,
.daily-board,
.settings-grid,
[data-settings-panel="plan"],
#calfProfile,
#screen-calves .table-panel.compact {
  min-width: 0;
}

#screen-daily .table-wrap,
#screen-calves .table-wrap,
#screen-calves .profile-table-wrap,
#screen-settings .feeding-matrix {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 1200px) {
  .daily-layout { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .focus-panel { display: none; }
  .summary-grid { grid-template-columns: minmax(0, 1fr) 96px; }
  .summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-row { grid-template-columns: 82px minmax(108px, 1fr) 138px; }
  .slot-board-side { grid-template-columns: 1fr; }
  .hero-copy { min-height: 0; }
  .hero-side { display: grid; justify-items: stretch; }
  .farm-hub-overview { grid-template-columns: 1fr; }
  .daily-board { order: 2; }
  .table-panel,
  .profile-panel,
  .setting-card { padding: 14px; }
  .settings-toolbar-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .settings-tabs {
    flex-wrap: wrap;
  }
  .annual-summary-wrap table { min-width: 880px !important; }
  .calves-list-table { min-width: 1080px; }
  .profile-history-table { min-width: 820px; }
  #screen-settings .feeding-matrix {
    padding-bottom: 6px;
  }
  .feeding-default-time-row {
    min-width: 1040px;
  }
  .feeding-plan-header,
  .feeding-plan-row {
    min-width: 1320px;
  }
  .profile-panel .header-actions {
    gap: 4px;
  }
  .profile-panel .action-button {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 0.76rem;
  }
  .stock-title-row {
    gap: 8px;
    flex-wrap: wrap;
  }
  .stock-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bottom-nav {
    width: min(calc(var(--bottom-nav-columns, 5) * 124px + 12px), calc(100% - 20px));
  }
}

@media (max-width: 900px) {
  .app-shell { padding: 18px 18px 220px; }
  .section-head,
  .screen-intro,
  .calendar-toolbar { flex-direction: column; }
  .calendar-nav,
  .calendar-jump { justify-content: space-between; width: 100%; }
  .feeding-plan-row,
  .legend-edit-row { grid-template-columns: 1fr 1fr; }
  .daily-quickstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-transfer-grid,
  .data-transfer-range { grid-template-columns: 1fr; }
  th, td { padding: 12px 10px; }
  input, select { min-height: 44px; }
  .hero {
    gap: 10px;
  }
  .hero-copy h1 {
    font-size: 2rem;
  }
  .hero-copy p {
    font-size: 0.95rem;
  }
  .summary-strip-cell {
    min-height: 54px;
    padding: 6px 8px;
  }
  .summary-strip-cell span {
    font-size: 0.72rem;
  }
  .summary-strip-cell strong {
    font-size: 1rem;
  }
  .slot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .slot-row {
    grid-template-columns: 78px minmax(92px, 1fr) 132px;
  }
  .slot-row-label,
  .slot-row-amount,
  .slot-row-time {
    min-height: 42px;
    padding: 3px 5px;
  }
  .slot-row-label {
    font-size: 0.74rem;
  }
  .slot-row-amount {
    font-size: 0.8rem;
  }
  .slot-row-time input {
    min-height: 28px;
    padding: 2px 24px 2px 4px;
    font-size: 0.88rem;
  }
  .table-panel,
  .profile-panel,
  .setting-card {
    padding: 12px;
  }
  .section-head h2,
  .profile-panel h3 {
    font-size: 1rem;
  }
  .profile-panel .header-actions {
    justify-content: flex-start;
  }
  .profile-panel .action-button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.74rem;
  }
  .annual-summary-wrap table {
    min-width: 820px !important;
  }
  .calves-list-table {
    min-width: 980px;
  }
  .profile-history-table,
  .profile-summary-table {
    min-width: 760px;
  }
  .stock-summary-cell {
    min-height: 72px;
  }
  .stock-summary-cell strong {
    font-size: 0.96rem;
  }
  .bottom-nav {
    width: min(calc(var(--bottom-nav-columns, 5) * 116px + 10px), calc(100% - 16px));
    gap: 4px;
    padding: 5px;
  }
  .nav-item {
    padding: 11px 8px;
    font-size: 0.84rem;
  }
}

@media (max-width: 720px) {
  .bottom-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .settings-grid,
  .profile-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; gap: 0; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-side { padding-top: 4px; }
  .hero-console-bar { align-items: stretch; justify-content: stretch; }
  .hero-farm-switch { min-width: 100%; }
  .summary-logout-button { border-left: none; border-top: none; }
  .farm-hub-toolbar { justify-content: stretch; align-items: stretch; flex-direction: column; }
  .farm-hub-toolbar input { width: 100%; }
  .settings-toolbar-row { flex-direction: column; align-items: stretch; }
  .farm-hub-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .farm-hub-table-wrap { overflow-x: auto; }
  .summary-strip-cell { min-height: 46px; padding: 2px 5px; }
  .summary-strip-cell span { font-size: 0.68rem; }
  .summary-strip-cell strong { font-size: 0.9rem; }
  .stock-summary-strip { grid-template-columns: 1fr; }
  .stock-summary-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-summary-cell { min-height: 74px; }
  .stock-month-nav { grid-template-columns: 1fr; gap: 8px; }
  .stock-title-row { padding-left: 8px; padding-right: 8px; }
  .stock-page .table-wrap { overflow-x: auto; }
  .stock-entry-table,
  .stock-monthly-table { min-width: 920px; }
  .slot-grid { grid-template-columns: 1fr; }
  .slot-row { grid-template-columns: 70px minmax(96px, 1fr) 124px; }
  .slot-row-label,
  .slot-row-amount,
  .slot-row-time { min-height: 40px; padding: 2px 4px; }
  .slot-row-label { font-size: 0.72rem; }
  .slot-row-amount { font-size: 0.78rem; }
  .slot-row-time input { min-height: 26px; padding: 1px 22px 1px 3px; font-size: 0.86rem; }
  .table-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }
  .table-head h2 { font-size: 0.92rem; }
  .daily-table-actions {
    justify-content: end;
  }
  .hero-actions #saveButton,
  .hero-actions #printDailyButton {
    display: none;
  }
  .bottom-nav { width: calc(100% - 16px); bottom: 8px; }
  .nav-item { padding: 12px 8px; font-size: 0.86rem; }
  table { min-width: 900px; }
  .daily-board table { min-width: 940px; }
  .daily-calf-grid,
  .touch-actions { grid-template-columns: 1fr; }
  .calendar-board {
    overflow-x: auto;
  }
  .calendar-weekdays,
  .calendar-grid {
    min-width: 840px;
  }
  .modal-card {
    width: min(96vw, 100%);
    padding: 10px;
  }
  .modal-grid-2,
  .modal-photo-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .modal-field-hint {
    margin-top: -4px;
  }
  .modal-photo-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-photo-actions .primary-button {
    width: 100%;
    min-width: 0;
  }
}

@media (hover: none) and (pointer: coarse) {
  .app-shell {
    padding-bottom: 228px;
  }
}

body.tablet-fixed .app-shell {
  max-width: none;
  min-width: 1180px;
  padding: 28px 28px 228px;
}

body.tablet-fixed .hero {
  grid-template-columns: minmax(320px, 1fr) minmax(700px, 0.98fr);
  gap: 12px;
  padding: 8px 10px 6px;
}

body.tablet-fixed .hero-copy h1 {
  font-size: clamp(1.04rem, 1.5vw, 1.55rem);
}

body.tablet-fixed .summary-grid {
  grid-template-columns: minmax(0, 1fr) 92px;
}

body.tablet-fixed .summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.tablet-fixed .table-panel,
body.tablet-fixed .profile-panel,
body.tablet-fixed .setting-card {
  padding: 12px;
}

body.tablet-fixed .section-head,
body.tablet-fixed .screen-intro {
  flex-direction: row;
  align-items: flex-start;
}

body.tablet-fixed .calendar-toolbar {
  grid-template-columns: 1fr auto 1fr;
}

body.tablet-fixed .calendar-nav,
body.tablet-fixed .calendar-jump {
  width: auto;
  justify-content: center;
}

body.tablet-fixed .daily-quickstats {
  grid-template-columns: 1fr;
}

body.tablet-fixed .table-head {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.tablet-fixed .table-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

body.tablet-fixed .slot-grid {
  grid-template-columns: repeat(var(--slot-columns, 4), minmax(0, 1fr));
  gap: 6px 10px;
}

body.tablet-fixed .slot-row {
  grid-template-columns: 92px minmax(132px, 1fr) 156px;
}

body.tablet-fixed .slot-row-label,
body.tablet-fixed .slot-row-amount,
body.tablet-fixed .slot-row-time {
  min-height: 46px;
  padding: 2px 6px;
}

body.tablet-fixed .slot-row-label {
  font-size: 0.8rem;
}

body.tablet-fixed .slot-row-amount {
  font-size: 0.84rem;
}

body.tablet-fixed .slot-row-time input {
  min-height: 24px;
  padding: 0 28px 0 8px;
  width: 124px;
  max-width: calc(100% - 8px);
  font-size: 0.92rem;
}

body.tablet-fixed .daily-table-actions {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap !important;
  gap: 4px;
  margin-left: auto;
}

body.tablet-fixed .daily-table-actions .primary-button,
body.tablet-fixed .daily-table-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

body.tablet-fixed .daily-board table {
  min-width: 1080px;
}

body.tablet-fixed .daily-board th,
body.tablet-fixed .daily-board td {
  padding: 9px 7px;
  font-size: 0.78rem;
}

body.tablet-fixed .annual-summary-wrap thead th,
body.tablet-fixed .calves-list-table thead th,
body.tablet-fixed .stock-entry-table thead th,
body.tablet-fixed .stock-monthly-table thead th {
  padding: 7px 8px;
  font-size: 0.78rem;
  line-height: 1.15;
}

body.tablet-fixed .annual-summary-wrap tbody td,
body.tablet-fixed .calves-list-table tbody td,
body.tablet-fixed .stock-entry-table tbody td,
body.tablet-fixed .stock-monthly-table tbody td {
  padding: 6px 8px;
  font-size: 0.84rem;
  line-height: 1.2;
}

body.tablet-fixed .annual-summary-wrap table {
  min-width: 880px !important;
}

body.tablet-fixed .annual-summary-toggle {
  min-width: 22px;
  min-height: 22px;
  font-size: 0.88rem;
}

body.tablet-fixed .calves-list-table {
  min-width: 1080px;
}

body.tablet-fixed .profile-summary-table,
body.tablet-fixed .profile-history-table {
  min-width: 820px;
}

body.tablet-fixed .stock-summary-six {
  grid-template-columns: repeat(6, minmax(128px, 1fr));
}

body.tablet-fixed .stock-summary-cell {
  min-height: 74px;
  padding: 8px 6px;
}

body.tablet-fixed .stock-summary-six .stock-summary-cell span {
  font-size: 0.74rem;
  letter-spacing: -0.03em;
}

body.tablet-fixed .stock-summary-six .stock-summary-cell strong {
  margin-top: 4px;
  font-size: 1.28rem;
}

body.tablet-fixed .stock-entry-table tbody td,
body.tablet-fixed .stock-monthly-table tbody td {
  min-height: 42px;
}

body.tablet-fixed .stock-entry-table input,
body.tablet-fixed .stock-entry-table select {
  min-height: 32px;
  font-size: 0.84rem;
}

body.tablet-fixed .settings-toolbar-row {
  flex-wrap: wrap;
  gap: 10px;
}

body.tablet-fixed .feeding-default-time-row {
  min-width: 1080px;
  padding: 0 0 12px;
  margin-bottom: 12px;
}

body.tablet-fixed .feeding-default-time-label span,
body.tablet-fixed .feeding-default-time-item span {
  font-size: 0.76rem;
}

body.tablet-fixed .feeding-plan-header,
body.tablet-fixed .feeding-plan-row {
  min-width: 1380px;
}

body.tablet-fixed .feeding-plan-header {
  padding: 0 0 7px;
  font-size: 0.8rem;
}

body.tablet-fixed .feeding-plan-row {
  padding: 8px 0;
}

body.tablet-fixed .feeding-plan-row input,
body.tablet-fixed .feeding-plan-row select {
  min-height: 32px;
  font-size: 0.84rem;
}

body.tablet-fixed .data-transfer-grid,
body.tablet-fixed .data-transfer-range {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.tablet-fixed .bottom-nav {
  width: min(calc(var(--bottom-nav-columns, 5) * 136px + 12px), calc(100% - 24px));
  bottom: 14px;
  gap: 6px;
  padding: 6px;
}

body.tablet-fixed .nav-item {
  padding: 12px 10px;
  font-size: 0.88rem;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    background: white;
  }

  .page-glow,
  .bottom-nav,
  .hero-actions,
  .hero-meta,
  .focus-panel,
  .calendar-toolbar,
  .calendar-detail,
  .screen:not(#screen-daily),
  .daily-viewbar,
  .legend-row,
  .daily-quickbar,
  .modal-overlay,
  .header-actions,
  .status-filter,
  #dailyCardList,
  .table-head .help-text {
    display: none !important;
  }

  .app-shell {
    max-width: none;
    padding: 0;
  }

  .hero,
  .table-panel,
  .profile-panel,
  .setting-card {
      box-shadow: none;
      border: 1px solid #bbb;
      background: white;
  }

  .hero {
    grid-template-columns: 1fr;
    margin-bottom: 6px;
    padding: 8px 10px;
    border-radius: 0;
  }

  .hero-copy h1 {
    font-size: 18px;
  }

  .daily-layout {
    display: block;
  }

  .daily-sidebar {
    display: none;
  }

  .table-panel {
    margin-bottom: 0;
    padding: 6px;
    border-radius: 0;
  }

  .table-head {
    margin-bottom: 4px;
  }

  .table-head .eyebrow {
    font-size: 8px;
  }

  .table-head h2 {
    font-size: 12px;
  }

  .table-wrap {
      overflow: auto;
      border: 1px solid var(--line);
    }

  .table-card-mode .table-wrap {
    display: block !important;
  }

  table {
    min-width: 0;
    width: 100%;
    font-size: 8.5px;
    table-layout: fixed;
  }

  .detail-col {
    display: none !important;
  }

  th,
  td {
    padding: 3px 4px;
    border-color: #ccc;
    line-height: 1.15;
    white-space: nowrap;
    vertical-align: middle;
  }

  th:first-child,
  td:first-child,
  th:nth-child(2),
  td:nth-child(2) {
    position: static;
    background: white;
  }

  th:nth-child(1),
  td:nth-child(1) { width: 4%; }

  th:nth-child(2),
  td:nth-child(2) { width: 9%; }

  th:nth-child(3),
  td:nth-child(3) { width: 5%; }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) { width: 8%; }

  th:nth-child(6),
  td:nth-child(6),
  th:nth-child(7),
  td:nth-child(7) { width: 7%; }

  th:nth-child(8),
  td:nth-child(8),
  th:nth-child(9),
  td:nth-child(9),
  th:nth-child(10),
  td:nth-child(10) { width: 10%; }

  input,
  textarea,
  select,
  button {
    min-height: auto;
    font-size: 8.5px !important;
    line-height: 1.1;
  }

  input,
  textarea,
  select {
    border: none;
    background: transparent !important;
    padding: 0;
    min-height: auto;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    color: #111 !important;
    width: 100%;
  }

  textarea {
    resize: none;
    overflow: hidden;
  }

  .predicted,
  .measure-weight,
  .measure-height {
    background: transparent !important;
  }

  .action-button,
  .primary-button,
  .secondary-button,
  .ghost-button {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #111;
    padding: 0;
  }

  .action-group {
    display: flex;
    justify-content: center;
  }

  .action-group .status-pill {
    text-align: center;
  }

  .action-group .action-button {
    display: none !important;
  }

  .status-pill {
    border: none;
    background: transparent !important;
    color: #111 !important;
    padding: 0;
    min-height: auto;
    font-weight: 600;
  }

  .table-panel {
    page-break-inside: auto;
    break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.print-calf-profile .hero,
  body.print-calf-profile .screen-intro,
  body.print-calf-profile #screen-calves > .table-panel.compact,
  body.print-calf-profile #screen-stock,
  body.print-calf-profile #screen-calendar,
  body.print-calf-profile #screen-settings,
  body.print-calf-profile .bottom-nav,
  body.print-calf-profile .header-actions {
    display: none !important;
  }

  body.print-calf-profile .screen {
    display: none !important;
  }

  body.print-calf-profile #screen-calves {
    display: grid !important;
    gap: 10px;
  }

  body.print-calf-profile #calfProfile {
    display: grid !important;
    border: 1px solid #bbb;
    padding: 10px;
    background: #fff;
  }

  body.print-calf-profile .trend-chart {
    border: 1px solid #bbb;
    padding: 8px 10px 4px;
  }

  body.print-calf-profile .trend-chart-legend {
    margin-bottom: 4px;
    font-size: 8.5px;
  }

  body.print-calf-profile .profile-box {
    border: 1px solid #ccc;
    padding: 6px 8px;
  }

  body.print-calf-profile .profile-summary-table,
  body.print-calf-profile .profile-history-table {
    font-size: 10px;
  }

  body.print-calf-profile .profile-summary-table th,
  body.print-calf-profile .profile-summary-table td,
  body.print-calf-profile .profile-history-table th,
  body.print-calf-profile .profile-history-table td {
    padding: 4px 6px;
  }
}
