@import "tailwindcss";

:root {
  --ink: #172019;
  --muted: #687069;
  --line: #e3e6df;
  --canvas: #f4f5f1;
  --paper: #ffffff;
  --forest: #233c2d;
  --forest-2: #345943;
  --leaf: #7ea66b;
  --lime: #b9d69c;
  --sand: #d7c891;
  --red: #cc5a52;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, a, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }

/* Safari amplia automaticamente a página ao focar controles menores que 16px. */
@media (hover: none) and (pointer: coarse), (max-width: 720px) {
  input, select, textarea { font-size: 16px !important; }
  button, a, input, select, textarea { touch-action: manipulation; }
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column;
  padding: 28px 20px 22px; color: #fff;
  background: radial-gradient(circle at 0 100%, rgba(185, 214, 156, .14), transparent 36%), var(--forest);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-button { width: 100%; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  background: var(--lime); color: var(--forest); font-weight: 900; letter-spacing: -.06em;
  box-shadow: inset 0 -5px 12px rgba(35, 60, 45, .12);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.57); font-size: 11px; }
.side-nav { display: grid; gap: 6px; margin-top: 46px; }
.side-nav button {
  width: 100%; border: 0; background: transparent; text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 12px;
  color: rgba(255,255,255,.68); text-decoration: none; font-size: 13px; font-weight: 650; transition: .2s ease;
}
.side-nav button > .nav-icon-box {
  flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  color: rgba(255,255,255,.8); background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.side-nav .nav-icon-box svg { width: 19px; height: 19px; display: block; }
.side-nav button:hover, .side-nav button.active { background: rgba(255,255,255,.1); color: #fff; }
.side-nav button:hover > .nav-icon-box { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); transform: translateY(-1px); }
.side-nav button.active { box-shadow: inset 3px 0 var(--lime); }
.side-nav button.active > .nav-icon-box { color: #f5faef; background: rgba(185,214,156,.18); border-color: rgba(185,214,156,.35); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.sidebar-note {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 13px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.045);
}
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { margin-top: 2px; font-size: 10px; color: rgba(255,255,255,.52); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9edb82; box-shadow: 0 0 0 4px rgba(158,219,130,.12); }

.main-content { margin-left: 248px; padding: 32px 42px 48px; max-width: 1580px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 4px; color: #818881; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.admin-badge, .admin-login { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 9px; font-weight: 800; text-decoration: none; }
.admin-badge { color: #476743; background: #e9f2e3; }
.admin-login { color: var(--forest); border: 1px solid #dce1da; background: #fff; }
.account-button { min-height: 34px; padding: 0 10px; border: 1px solid #dce1da; border-radius: 10px; color: #5a655a; background: #fff; font-size: 9px; font-weight: 800; }
.account-button:hover { border-color: #b8c4b7; background: #f8faf6; }
.icon-button, .primary-button { border: 0; border-radius: 12px; }
.icon-button { width: 42px; height: 42px; color: var(--red); background: var(--paper); border: 1px solid var(--line); font-size: 9px; }
.primary-button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 12px; color: white; background: var(--forest); font-size: 12px; font-weight: 750; box-shadow: 0 8px 18px rgba(35,60,45,.16); }
.primary-button span { margin-right: 5px; font-size: 16px; vertical-align: -1px; }
.secondary-button { min-height: 40px; padding: 0 15px; border: 1px solid #dce1da; border-radius: 11px; color: var(--forest); background: #fff; font-size: 10px; font-weight: 800; }
.secondary-button:hover { border-color: #b8c4b7; background: #f8faf6; }
.button-pair { display: flex; flex-wrap: wrap; gap: 8px; }

.error-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #efd0cc; border-radius: 13px; color: #8d3d37; background: #fff4f2; font-size: 11px; font-weight: 650; }
.error-banner > span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; color: #fff; background: var(--red); font-weight: 900; }
.error-banner button { margin-left: auto; border: 0; color: inherit; background: transparent; font-size: 18px; }
.toast { position: fixed; top: 22px; right: 24px; z-index: 80; padding: 13px 17px; border-radius: 13px; color: #fff; background: var(--forest); box-shadow: 0 16px 38px rgba(23,32,25,.24); font-size: 11px; font-weight: 750; animation: toast-in .25s ease both; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 12% 10%, rgba(185,214,156,.38), transparent 30%), linear-gradient(135deg, #f6f8f3, #e9eee5); }
.auth-card { width: min(100%, 420px); padding: 42px; border: 1px solid rgba(35,60,45,.1); border-radius: 26px; background: rgba(255,255,255,.96); box-shadow: 0 25px 65px rgba(35,60,45,.15); text-align: center; }
.auth-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 23px; border-radius: 17px; color: var(--forest); background: var(--lime); font-size: 18px; font-weight: 900; letter-spacing: -.08em; }
.auth-card h1 { margin: 0; color: var(--forest); font-size: 30px; letter-spacing: -.055em; }
.auth-copy { margin: 11px 0 27px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-form { display: grid; gap: 15px; text-align: left; }
.auth-form label, .password-modal label { display: grid; gap: 7px; color: #596359; font-size: 11px; font-weight: 800; }
.auth-form input, .password-modal input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #dce3d9; border-radius: 11px; outline: 0; color: var(--ink); background: #fbfcfa; font-size: 13px; }
.auth-form input:focus, .password-modal input:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(126,166,107,.16); }
.auth-submit { width: 100%; margin-top: 5px; font-size: 13px; }
.auth-link { display: inline-block; margin-top: 21px; color: var(--forest-2); font-size: 11px; font-weight: 800; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-error, .auth-success { padding: 10px 11px; border-radius: 10px; font-size: 11px; font-weight: 700; line-height: 1.4; }
.auth-error { border: 1px solid #efd0cc; color: #8d3d37; background: #fff4f2; }
.auth-success { border: 1px solid #d4e8ce; color: #426f48; background: #f1f8ee; }
.password-modal { width: min(100%, 420px); }
.loading-state { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px; text-align: center; }
.loader { width: 42px; height: 42px; border: 4px solid #dce6d6; border-top-color: var(--forest-2); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state h2 { margin: 18px 0 5px; font-size: 18px; }.loading-state p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }

.hero-card {
  min-height: 168px; display: flex; justify-content: space-between; align-items: center; gap: 30px;
  padding: 30px 34px; border-radius: 24px; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 90% -30%, rgba(185,214,156,.25), transparent 46%), linear-gradient(128deg, var(--forest) 0%, #2e523c 100%);
  box-shadow: 0 18px 42px rgba(35,60,45,.13);
}
.hero-kicker { display: inline-block; margin-bottom: 10px; color: var(--lime); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.hero-copy h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.hero-copy p { max-width: 590px; margin: 10px 0 0; color: rgba(255,255,255,.65); font-size: 13px; line-height: 1.65; }
.hero-status { display: flex; align-items: center; gap: 28px; }
.alert-pill { white-space: nowrap; padding: 8px 12px; border-radius: 99px; background: rgba(204,90,82,.18); color: #ffc9c4; font-size: 10px; font-weight: 750; }
.alert-pill.clear { color: #d9f2c8; background: rgba(185,214,156,.15); }
.hero-date { display: flex; align-items: center; gap: 10px; min-width: 152px; padding-left: 26px; border-left: 1px solid rgba(255,255,255,.16); }
.hero-date strong { font-size: 46px; line-height: 1; letter-spacing: -.06em; }
.hero-date span { color: rgba(255,255,255,.62); font-size: 9px; font-weight: 750; line-height: 1.5; text-transform: uppercase; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.metric-card { min-height: 126px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.metric-card.green { color: #fff; border-color: var(--forest-2); background: var(--forest-2); }
.metric-card.warning { border-color: #ecd8d4; background: #fffafa; }
.metric-heading { display: flex; justify-content: space-between; color: #7e857f; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.green .metric-heading { color: rgba(255,255,255,.64); }
.metric-heading i { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; background: #f0f2ed; color: var(--forest); font-style: normal; }
.green .metric-heading i { color: #fff; background: rgba(255,255,255,.12); }
.warning .metric-heading i { color: var(--red); background: #f9e9e6; }
.metric-card > strong { display: block; margin-top: 10px; font-size: 26px; letter-spacing: -.045em; }
.metric-card > strong small { font-size: 11px; letter-spacing: 0; font-weight: 700; }
.metric-card p { margin: 4px 0 0; color: #8b928b; font-size: 10px; }
.green p { color: rgba(255,255,255,.58); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 16px; }
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.025em; }
.text-button, .more-button { border: 0; color: var(--forest-2); background: transparent; font-size: 10px; font-weight: 750; }
.more-button { color: #909790; font-size: 13px; }
.chart { height: 220px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 9px; align-items: end; padding: 34px 6px 0; }
.chart-column { height: 100%; display: grid; grid-template-rows: 18px 1fr 18px; text-align: center; }
.chart-column > span { color: #818881; font-size: 8px; }
.chart-track { height: 100%; display: flex; align-items: end; border-radius: 7px 7px 3px 3px; background: #f1f3ef; overflow: hidden; }
.chart-track i { width: 100%; min-height: 6px; border-radius: 7px 7px 3px 3px; background: linear-gradient(#9bbe83, #668e58); }
.chart-column small { padding-top: 6px; color: #8a918b; font-size: 8px; }
.chart-legend { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 14px; border-top: 1px solid #eef0ec; color: #888f88; font-size: 9px; }
.chart-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; background: var(--leaf); }
.chart-legend strong { color: var(--ink); }
.donut-row { display: flex; align-items: center; gap: 22px; min-height: 220px; }
.donut { flex: 0 0 122px; height: 122px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--leaf) 0 35%, var(--sand) 35% 64%, #a7bec0 64% 85%, #d9ddd7 85% 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 21px; border-radius: 50%; background: #fff; }
.donut span { position: relative; z-index: 1; text-align: center; color: #8b918b; font-size: 8px; }
.donut strong { display: block; color: var(--ink); font-size: 23px; }
.legend-list { flex: 1; display: grid; gap: 13px; }
.legend-list span { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 7px; color: #727972; font-size: 9px; }
.legend-list i { width: 7px; height: 7px; border-radius: 50%; }
.legend-list strong { color: var(--ink); }
.legend-list .gestando { background: var(--leaf); }.legend-list .inseminar { background: var(--sand); }.legend-list .desenvolvimento { background: #a7bec0; }.legend-list .outros { background: #d9ddd7; }

.soft-badge { padding: 6px 9px; border-radius: 99px; color: #677766; background: #eef4e9; font-size: 8px; font-weight: 750; }
.calving-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-top: 19px; }
.calving-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px; border-radius: 12px; background: #f8f9f6; }
.animal-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--forest); background: #e8efdf; font-size: 10px; font-weight: 850; }
.animal-avatar.soon { color: #7b5e22; background: #f5ebc7; }
.calving-item strong, .calving-item small { display: block; }
.calving-item strong { font-size: 10px; }.calving-item small { margin-top: 2px; color: #969c96; font-size: 8px; }.calving-item time { color: #566057; font-size: 9px; font-weight: 750; }
.attention-count { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 9px; color: white; background: var(--red); font-size: 9px; font-weight: 800; }
.task-list { display: grid; gap: 8px; margin-top: 16px; }
.task { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #eef0ec; border-radius: 12px; }
.task > i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--forest); background: #edf3e8; font-style: normal; font-size: 10px; font-weight: 850; }
.task.urgent > i { color: var(--red); background: #fbe9e7; }
.task strong, .task small { display: block; }.task strong { font-size: 9px; }.task small { margin-top: 2px; color: #969c96; font-size: 8px; }
.task button { border: 0; color: var(--forest-2); background: transparent; font-size: 8px; font-weight: 800; }

.quick-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 16px; }
.quick-actions button { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; text-align: left; }
.quick-actions button:hover { border-color: #becbbb; box-shadow: 0 8px 24px rgba(35,60,45,.07); transform: translateY(-1px); }
.quick-actions span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--forest); background: #edf3e8; font-weight: 850; }
.quick-actions strong { font-size: 10px; }.quick-actions small { margin-top: 2px; color: #929991; font-size: 8px; }

.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.section-intro > div:first-child { display: flex; align-items: center; gap: 14px; }
.intro-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: var(--forest); background: #e9f1e3; font-size: 17px; font-weight: 850; }
.section-intro h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }.section-intro p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.mini-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.mini-metrics.herd-mini { grid-template-columns: repeat(5, 1fr); }
.mini-metrics article { padding: 17px 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mini-metrics span { display: block; color: #818881; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }.mini-metrics strong { display: block; margin-top: 6px; font-size: 22px; letter-spacing: -.04em; }.mini-metrics article.danger { color: #923f39; border-color: #ecd8d4; background: #fff9f8; }.mini-metrics .date-value { font-size: 17px; }

.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-heading { padding: 21px 22px 0; }
.table-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #edf0eb; }
.search-field { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 39px; padding: 0 12px; border: 1px solid #dfe4dd; border-radius: 11px; color: #8a918a; background: #fafbf9; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.table-toolbar select { height: 39px; min-width: 190px; padding: 0 12px; border: 1px solid #dfe4dd; border-radius: 11px; color: #525b53; background: #fff; font-size: 10px; outline: 0; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table.herd-table { min-width: 1120px; }
.data-table th { padding: 11px 14px; color: #818881; background: #f7f8f5; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 12px 14px; border-top: 1px solid #eef0ec; color: #626a63; font-size: 9px; }
.data-table tbody tr:hover { background: #fbfcfa; }
.data-table td:first-child { color: var(--ink); }
.data-table td:first-child strong { vertical-align: middle; }
.table-animal { display: inline-grid; place-items: center; width: 29px; height: 29px; margin-right: 8px; border-radius: 9px; color: var(--forest); background: #e9f0e4; font-size: 8px; font-weight: 850; vertical-align: middle; }
.animal-cell-copy { display: inline-flex; flex-direction: column; vertical-align: middle; }
.animal-cell-copy small { margin-top: 2px; color: #969c96; font-size: 7px; }
.status-chip { display: inline-flex; padding: 5px 7px; border-radius: 7px; font-size: 7px; font-weight: 850; letter-spacing: .025em; white-space: nowrap; }
.status-chip.positive { color: #3c6c43; background: #e6f3e2; }.status-chip.waiting { color: #836321; background: #f5edcf; }.status-chip.attention { color: #9d443e; background: #f8e5e2; }.status-chip.neutral { color: #637072; background: #e9eff0; }
.no-results { padding: 38px; color: #8a918a; text-align: center; font-size: 10px; }
.recent-table { margin-top: 16px; }.recent-table .table-scroll { margin-top: 14px; }
.positive-text { color: #488255 !important; font-weight: 750; }.negative-text { color: var(--red) !important; font-weight: 750; }
.table-action { padding: 6px 9px; border: 0; border-radius: 8px; color: #fff; background: var(--forest-2); font-size: 8px; font-weight: 800; }.table-action.secondary { color: var(--forest); background: #eaf1e6; }.muted-action { color: #8a918a; font-size: 8px; }
.discarded-row { background: #faf7f4; opacity: .78; }

.production-metrics { margin-top: 0; }
.production-detail-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .65fr); }
.summary-list { display: grid; gap: 0; margin-top: 18px; }
.summary-list div { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid #eef0ec; }.summary-list span { color: #7b837c; font-size: 9px; }.summary-list strong { font-size: 10px; }
.empty-panel { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 8px; color: #8b938c; }.empty-panel span { font-size: 24px; }.empty-panel p { margin: 0; font-size: 10px; }

.reproduction-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.agenda-list { display: grid; margin-top: 16px; }
.agenda-item { display: grid; grid-template-columns: 35px 110px 1fr 75px; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #eef0ec; }.agenda-item:first-child { border-top: 0; }
.agenda-item strong, .agenda-item small { display: block; }.agenda-item strong { font-size: 9px; }.agenda-item small { margin-top: 2px; color: #969c96; font-size: 8px; }.agenda-item time { color: #566057; font-size: 9px; font-weight: 750; text-align: right; }
.agenda-progress { height: 6px; border-radius: 99px; background: #edf0eb; overflow: hidden; }.agenda-progress i { display: block; height: 100%; border-radius: inherit; background: var(--leaf); }
.waiting-list { display: grid; gap: 9px; margin-top: 16px; }.waiting-list > div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 11px; border-radius: 12px; background: #f8f9f6; }.waiting-list strong, .waiting-list small { display: block; }.waiting-list strong { font-size: 9px; }.waiting-list small { margin-top: 2px; color: #929991; font-size: 8px; }.waiting-list button { border: 0; color: var(--forest-2); background: transparent; font-size: 8px; font-weight: 800; }

.health-alert { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 25px; border: 1px solid #ecd0cc; border-radius: 20px; background: #fff7f5; }
.health-alert.clear { border-color: #d8e5d2; background: #f6fbf3; }.health-alert > div { display: flex; align-items: center; gap: 15px; }.health-alert > div > span { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 15px; color: #fff; background: var(--red); font-size: 18px; font-weight: 900; }.health-alert.clear > div > span { background: var(--leaf); }.health-alert h2 { margin: 0; font-size: 18px; }.health-alert > div p:last-child { margin: 5px 0 0; color: #7a6966; font-size: 10px; }.health-alert.clear > div p:last-child { color: #647261; }
.lactotropin-panel { margin-bottom: 16px; padding: 22px; border: 1px solid #d8e6d1; border-radius: 20px; background: linear-gradient(135deg, #fbfdf9, #f1f7ed); }
.lactotropin-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }.lactotropin-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }.lactotropin-heading p:last-child { max-width: 640px; margin: 6px 0 0; color: #63705f; font-size: 10px; line-height: 1.5; }
.lactotropin-timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 19px; }.lactotropin-timeline article { min-height: 116px; padding: 13px; border: 1px solid #dbe6d6; border-radius: 13px; background: rgba(255,255,255,.82); }.lactotropin-timeline article.peak { border-color: #cadfbf; background: #eaf4e4; }.lactotropin-timeline article.reapply { border-color: #eadcb1; background: #fff9e9; }.lactotropin-timeline span, .lactotropin-timeline strong, .lactotropin-timeline small { display: block; }.lactotropin-timeline span { color: #72816e; font-size: 8px; font-weight: 850; letter-spacing: .07em; }.lactotropin-timeline strong { margin-top: 9px; color: var(--forest); font-size: 10px; }.lactotropin-timeline small { margin-top: 5px; color: #748073; font-size: 8px; line-height: 1.4; }
.lactotropin-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0 11px; }.lactotropin-summary span { padding: 7px 10px; border-radius: 9px; color: #5e6c5d; background: #e7f0e2; font-size: 9px; }.lactotropin-summary span.due { color: #8e433d; background: #f9e5e2; }.lactotropin-summary strong { margin-right: 4px; font-size: 12px; }
.lactotropin-cycle-list { display: grid; gap: 8px; }.lactotropin-cycle-list > div { display: grid; grid-template-columns: 34px minmax(150px, 1fr) minmax(190px, 1.2fr); align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid #dfe9da; border-radius: 12px; background: rgba(255,255,255,.78); }.lactotropin-cycle-list strong, .lactotropin-cycle-list small { display: block; }.lactotropin-cycle-list strong { font-size: 10px; }.lactotropin-cycle-list small { margin-top: 3px; color: #718071; font-size: 8px; line-height: 1.35; }.cycle-status { text-align: right; }.cycle-status small { margin-top: 5px; }.lactotropin-empty { margin-top: 14px; padding: 14px; border: 1px dashed #cad8c4; border-radius: 11px; color: #6b7868; background: rgba(255,255,255,.55); font-size: 9px; line-height: 1.5; }
.blocked-animal-panel { margin-bottom: 16px; }
.panel-helper { margin: 10px 0 0; color: #747c75; font-size: 9px; line-height: 1.55; }
.blocked-animal-list { display: grid; gap: 9px; margin-top: 16px; }
.blocked-animal-list > div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid #ecdcd8; border-radius: 12px; background: #fff9f8; }
.blocked-animal-list strong, .blocked-animal-list small { display: block; }.blocked-animal-list strong { font-size: 10px; }.blocked-animal-list small { margin-top: 3px; color: #8d7672; font-size: 8px; }
.blocked-animal-list .table-action { min-height: 34px; padding-inline: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(18,27,20,.55); backdrop-filter: blur(4px); animation: fade-in .18s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.entry-modal { position: relative; width: min(520px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: 29px; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(17,27,20,.28); animation: modal-in .22s ease both; }
@keyframes modal-in { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.entry-modal h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }.modal-description { margin: 7px 30px 22px 0; color: #707870; font-size: 10px; line-height: 1.55; }.modal-close { position: absolute; top: 18px; right: 18px; width: 31px; height: 31px; border: 0; border-radius: 10px; color: #657066; background: #f1f3ef; font-size: 18px; }
.entry-modal form { display: grid; gap: 14px; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.form-field { display: grid; gap: 6px; }.form-field > span { color: #58615a; font-size: 9px; font-weight: 800; }.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 0 12px; border: 1px solid #dce2da; border-radius: 11px; color: var(--ink); background: #fbfcfa; font: inherit; font-size: 10px; outline: 0; }.form-field input, .form-field select { height: 43px; }.form-field textarea { min-height: 74px; padding-top: 11px; resize: vertical; }.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #86a77d; box-shadow: 0 0 0 3px rgba(126,166,107,.13); }.form-helper { margin: -4px 0 1px; padding: 9px 10px; border-left: 3px solid #86a77d; border-radius: 0 8px 8px 0; color: #62705f; background: #f3f7ef; font-size: 9px; line-height: 1.45; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 7px; padding-top: 17px; border-top: 1px solid #edf0eb; }.modal-submit { min-width: 145px; }
.lactotropin-form-helper { margin-top: -5px; }.lactotropin-form-helper strong { font-size: inherit; }
.animal-details { width: min(820px, 100%); }
.animal-id-line { margin: 5px 0 0; color: #7e867f; font-size: 9px; }
.animal-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0; }
.animal-status-grid article { min-height: 69px; padding: 12px; border: 1px solid #e6e9e3; border-radius: 12px; background: #fafbf8; }
.animal-status-grid article > span { display: block; margin-bottom: 7px; color: #8b928b; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.animal-status-grid article > strong:not(.status-chip) { font-size: 10px; }
.discard-summary, .warning-box { display: grid; gap: 4px; margin: 0 0 18px; padding: 13px 15px; border: 1px solid #eadba9; border-radius: 12px; color: #735c21; background: #fff9e7; }
.discard-summary strong, .warning-box strong { font-size: 10px; }.discard-summary span, .warning-box span { font-size: 9px; line-height: 1.5; }
.warning-box.danger { border-color: #edcbc7; color: #8c3d37; background: #fff3f1; }
.animal-note { display: grid; gap: 4px; margin-bottom: 14px; padding: 13px 15px; border-radius: 12px; color: #536055; background: #f4f7f1; }
.animal-note strong { font-size: 9px; }.animal-note span { font-size: 9px; line-height: 1.5; }
.operational-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 4px 0 16px; }
.operational-strip > div { padding: 12px; border: 1px solid #e6e9e3; border-radius: 12px; background: #fafbf8; }
.operational-strip span { display: block; margin-bottom: 7px; color: #8b928b; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }.operational-strip strong { font-size: 10px; }
.period-history { display: grid; gap: 8px; margin: 5px 0 18px; padding: 15px; border: 1px solid #e5e9e1; border-radius: 13px; background: #fbfcfa; }
.period-history > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid #ecefe9; }.period-history strong { font-size: 9px; }.period-history span { color: #7d857e; font-size: 8px; text-align: right; }
.timeline-heading { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf0eb; }.timeline-heading h3 { margin: 0; font-size: 14px; }
.animal-timeline { display: grid; margin-top: 12px; }
.animal-timeline > div { display: grid; grid-template-columns: 78px 13px 1fr; gap: 9px; min-height: 49px; }
.animal-timeline time { padding-top: 2px; color: #8b928b; font-size: 8px; text-align: right; }
.animal-timeline i { position: relative; width: 8px; height: 8px; margin-top: 3px; border: 2px solid #8dae7d; border-radius: 50%; background: #fff; }
.animal-timeline i::after { content: ""; position: absolute; top: 7px; left: 1px; width: 2px; height: 35px; background: #e1e7dd; }
.animal-timeline > div:last-of-type i::after { display: none; }
.animal-timeline section { padding-bottom: 13px; }.animal-timeline section strong, .animal-timeline section span { display: block; }.animal-timeline section strong { font-size: 9px; }.animal-timeline section span { margin-top: 3px; color: #7f8780; font-size: 9px; line-height: 1.4; }
.no-timeline { padding: 18px; color: #8b928b; background: #f8f9f6; border-radius: 12px; text-align: center; font-size: 9px; }
.animal-management { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 8px; padding-top: 18px; border-top: 1px solid #edf0eb; }
.operational-actions .dry-button { color: #765c20; border-color: #e5d59e; background: #fff8e4; }
.operational-actions .unblock-button { color: #3c6c43; border-color: #cfe0ca; background: #eef7ea; }
.danger-button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 11px; color: #fff; background: #aa4740; font-size: 10px; font-weight: 800; }
.admin-note { display: block; margin-top: 12px; padding: 12px; border-radius: 11px; color: var(--forest); background: #eef4ea; text-align: center; font-size: 9px; font-weight: 750; text-decoration: none; }

/* Tipografia ampliada para leitura confortável no uso diário da fazenda. */
body { font-size: 18px; }
.brand strong { font-size: 18px; }.brand small { font-size: 14px; }
.side-nav button { font-size: 16px; }.sidebar-note strong { font-size: 14px; }.sidebar-note small { font-size: 13px; }
.eyebrow { font-size: 13px; }.topbar h1 { font-size: 32px; }
.admin-badge, .admin-login, .primary-button, .secondary-button { font-size: 14px; }
.error-banner, .toast, .loading-state p { font-size: 14px; }.loading-state h2 { font-size: 23px; }
.hero-kicker { font-size: 13px; }.hero-copy h2 { font-size: 34px; }.hero-copy p { font-size: 17px; }.alert-pill, .hero-date span { font-size: 13px; }
.metric-heading, .metric-card p { font-size: 14px; }.metric-card > strong { font-size: 32px; }.metric-card > strong small { font-size: 14px; }
.panel-heading h3 { font-size: 20px; }.text-button, .more-button { font-size: 14px; }
.chart-column > span, .chart-column small, .chart-legend, .legend-list span { font-size: 12px; }
.soft-badge { font-size: 12px; }.calving-item strong, .calving-item time { font-size: 14px; }.calving-item small { font-size: 12px; }
.task strong, .task button, .quick-actions strong { font-size: 14px; }.task small, .quick-actions small { font-size: 12px; }
.section-intro h2 { font-size: 24px; }.section-intro p { font-size: 14px; }
.mini-metrics span { font-size: 12px; }.mini-metrics strong { font-size: 28px; }
.search-field input, .table-toolbar select { font-size: 15px; }.data-table th { font-size: 11px; }.data-table td { font-size: 15px; }
.animal-cell-copy small, .status-chip, .table-animal, .table-action, .muted-action, .no-results { font-size: 12px; }
.summary-list span, .summary-list strong, .panel-helper { font-size: 14px; }
.agenda-item strong, .agenda-item time, .waiting-list strong { font-size: 14px; }.agenda-item small, .waiting-list small { font-size: 12px; }.waiting-list button { font-size: 12px; }
.health-alert h2 { font-size: 25px; }.health-alert p { font-size: 15px; }
.lactotropin-heading h3 { font-size: 20px; }.lactotropin-heading p:last-child { font-size: 14px; }.lactotropin-timeline span { font-size: 11px; }.lactotropin-timeline strong { font-size: 14px; }.lactotropin-timeline small { font-size: 12px; }.lactotropin-summary span { font-size: 13px; }.lactotropin-summary strong { font-size: 16px; }.lactotropin-cycle-list strong { font-size: 14px; }.lactotropin-cycle-list small, .lactotropin-empty { font-size: 12px; }
.blocked-animal-list strong { font-size: 14px; }.blocked-animal-list small { font-size: 12px; }
.entry-modal h2 { font-size: 28px; }.modal-description { font-size: 15px; }.form-field > span { font-size: 12px; }.form-field input, .form-field select, .form-field textarea { font-size: 15px; }.form-helper { font-size: 12px; }
.animal-id-line, .animal-status-grid article > span, .animal-status-grid article > strong:not(.status-chip) { font-size: 12px; }
.discard-summary strong, .warning-box strong, .animal-note strong, .operational-strip strong { font-size: 14px; }
.discard-summary span, .warning-box span, .animal-note span, .operational-strip span, .period-history strong { font-size: 12px; }
.period-history span, .animal-timeline time, .animal-timeline section strong, .animal-timeline section span, .no-timeline, .danger-button, .admin-note { font-size: 12px; }


.print-report-header { display: none; }
.export-pdf-button { display: inline-flex; align-items: center; gap: 6px; }
.export-pdf-button span { font-size: 16px; line-height: 1; }

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

  html, body {
    background: #fff !important;
    color: var(--ink) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body { font-size: 11pt !important; }
  .sidebar, .topbar, .top-actions, .error-banner, .toast, .modal-backdrop,
  .quick-actions, .text-button, .more-button, .table-action, .muted-action,
  .section-intro button, .health-alert button, .lactotropin-heading button {
    display: none !important;
  }

  .app-shell, .main-content {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-report-header {
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 0 0 12px;
    border-bottom: 1px solid #dfe5dc;
  }
  .print-report-header img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
  }
  .print-report-header div { display: grid; gap: 2px; }
  .print-report-header strong { font-size: 14pt; color: var(--forest); }
  .print-report-header span { font-size: 10pt; color: #687069; }
  .print-report-header small { margin-left: auto; font-size: 8.5pt; color: #7f877f; }

  .hero-card, .metric-card, .panel, .health-alert, .section-intro,
  .mini-metrics article, .lactotropin-panel {
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .table-scroll { overflow: visible !important; }
  .data-table { width: 100% !important; min-width: 0 !important; }
  .data-table thead { display: table-header-group; }
  .data-table tr { break-inside: avoid; page-break-inside: avoid; }

  .dashboard-grid, .bottom-grid, .metrics-grid, .production-detail-grid,
  .reproduction-grid, .mini-metrics {
    break-inside: auto;
  }

  a { color: inherit !important; text-decoration: none !important; }
}

@media (max-width: 1050px) {
  .sidebar { width: 82px; padding-inline: 13px; }
  .brand > span:last-child, .side-nav button { font-size: 0; }
  .brand { justify-content: center; padding: 0; }.side-nav button { justify-content: center; padding: 8px; }.side-nav button > .nav-icon-box { flex-basis: 38px; width: 38px; height: 38px; }
  .sidebar-note { justify-content: center; }.sidebar-note div { display: none; }
  .main-content { margin-left: 82px; padding-inline: 28px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }.reproduction-panel { min-height: auto; }
}

@media (max-width: 720px) {
  .sidebar { inset: auto 0 0 0; width: 100%; height: 68px; padding: 8px 10px; border-radius: 18px 18px 0 0; }
  .brand, .sidebar-note { display: none; }.side-nav { grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 0; }
  .side-nav button, .side-nav button.active { height: 52px; padding: 7px; border-radius: 12px; box-shadow: none; }
  .side-nav button > .nav-icon-box { flex-basis: 36px; width: 36px; height: 36px; }.side-nav .nav-icon-box svg { width: 18px; height: 18px; }.side-nav button.active { background: rgba(255,255,255,.12); }
  .main-content { margin: 0; padding: 22px 16px 96px; }
  .topbar h1 { font-size: 21px; }.admin-badge { display: none; }.admin-login { max-width: 94px; padding-inline: 9px; text-align: center; }.top-actions .primary-button { width: 42px; padding: 0; font-size: 0; }.top-actions .primary-button span { margin: 0; font-size: 18px; }.top-actions .export-pdf-button { width: 42px; padding: 0; font-size: 0; justify-content: center; }.top-actions .export-pdf-button span { font-size: 18px; }
  .hero-card { align-items: flex-start; min-height: 210px; padding: 25px; }.hero-copy h2 { font-size: 24px; }.hero-status { align-self: stretch; flex-direction: column; align-items: flex-end; gap: 12px; }.hero-date { min-width: 125px; padding-left: 16px; }.hero-date strong { font-size: 38px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { min-height: 118px; padding: 16px; }.metric-card > strong { font-size: 22px; }
  .bottom-grid { grid-template-columns: 1fr; }.panel { padding: 18px; }.chart { height: 190px; gap: 5px; padding-inline: 0; }
  .donut-row { justify-content: center; }.calving-list { grid-template-columns: 1fr; }
  .quick-actions, .mini-metrics, .mini-metrics.herd-mini { grid-template-columns: 1fr 1fr; }
  .section-intro, .health-alert, .lactotropin-heading { align-items: flex-start; flex-direction: column; }.section-intro > .secondary-button, .health-alert > .secondary-button, .lactotropin-heading > .secondary-button { width: 100%; }
  .lactotropin-timeline { grid-template-columns: repeat(3, 1fr); }
  .production-detail-grid, .reproduction-grid { grid-template-columns: 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }.search-field { max-width: none; }.table-toolbar select { width: 100%; }
  .agenda-item { grid-template-columns: 35px 90px 1fr 65px; }.agenda-progress { min-width: 60px; }
  .toast { top: 12px; left: 16px; right: 16px; text-align: center; }
}

@media (max-width: 440px) {
  .hero-card { display: block; }.hero-status { flex-direction: row; justify-content: space-between; align-items: center; margin-top: 24px; }.hero-date { border-left: 0; padding-left: 0; }
  .metrics-grid { grid-template-columns: 1fr; }.metric-card { min-height: 108px; }
  .donut-row { align-items: flex-start; }.donut { flex-basis: 105px; height: 105px; }.donut::after { inset: 18px; }
  .quick-actions, .mini-metrics, .mini-metrics.herd-mini, .operational-strip { grid-template-columns: 1fr; }
  .form-grid, .animal-status-grid { grid-template-columns: 1fr; }.entry-modal { padding: 24px 20px; }.modal-actions, .animal-management { flex-direction: column-reverse; }.modal-actions button, .animal-management button { width: 100%; }
  .period-history > div { align-items: flex-start; flex-direction: column; }.period-history span { text-align: left; }
  .blocked-animal-list > div { grid-template-columns: 34px 1fr; }.blocked-animal-list .table-action { grid-column: 1 / -1; width: 100%; }
  .lactotropin-timeline { grid-template-columns: 1fr; }.lactotropin-timeline article { min-height: 0; }.lactotropin-cycle-list > div { grid-template-columns: 34px 1fr; }.lactotropin-cycle-list .cycle-status { grid-column: 1 / -1; text-align: left; padding-left: 45px; }
  .agenda-item { grid-template-columns: 34px 1fr auto; }.agenda-progress { display: none; }
  .health-alert > div { align-items: flex-start; }
}

/* v20.7 — correção final do cabeçalho de PDF */
@media print {
  .print-report-header {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 14px 0 !important;
    padding: 0 0 10px 0 !important;
    transform: none !important;
    text-align: left !important;
  }
  .print-report-header img {
    position: static !important;
    display: block !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    object-fit: contain !important;
    transform: none !important;
  }
  .print-report-header div {
    margin: 0 !important;
    text-align: left !important;
  }
  .print-report-header small {
    margin-left: auto !important;
  }
}


/* v20.8 — logo da vaca no lugar do GL */
.auth-mark.auth-mark-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 23px;
  padding: 0;
  border-radius: 19px;
  background: transparent;
  overflow: hidden;
  box-shadow: 0 7px 18px rgba(35,60,45,.16);
}
.auth-mark.auth-mark-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}
.brand-mark.brand-mark-logo {
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}
.brand-mark.brand-mark-logo img {
  display: block;
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  object-fit: cover;
  border-radius: 13px;
}
@media (max-width: 720px) {
  .auth-mark.auth-mark-logo { width: 58px; height: 58px; border-radius: 17px; }
}

/* v20.12 — assinatura do desenvolvedor */
.developer-signature {
  margin-top: 10px;
  padding: 0 8px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}
.developer-signature span, .developer-signature small { display: block; }
.developer-signature strong { color: rgba(255,255,255,.82); font-weight: 750; }
.developer-signature small { margin-top: 2px; color: rgba(255,255,255,.38); font-size: 10px; }

.print-report-meta {
  margin-left: auto !important;
  display: grid !important;
  gap: 3px !important;
  justify-items: end;
  text-align: right !important;
}
.print-report-meta small { margin-left: 0 !important; }
.print-report-meta em {
  display: none;
  color: #7f877f;
  font-size: 7.8pt;
  font-style: normal;
  white-space: nowrap;
}
.print-report-meta em strong { color: var(--forest-2); font-size: inherit; }

@media print {
  .developer-signature { display: none !important; }
  .print-report-meta em { display: block !important; }
}

@media (max-width: 1050px) {
  .developer-signature { display: none; }
}


/* v21.3 — consulta histórica de coletas */
.production-filter-panel {
  margin: 0 0 16px;
  padding: 18px 20px;
  border: 1px solid #dfe6dc;
  border-radius: 18px;
  background: #f8faf6;
}
.production-filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.production-filter-heading h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.025em;
}
.production-filter-summary {
  display: grid;
  gap: 2px;
  min-width: 210px;
  text-align: right;
}
.production-filter-summary strong {
  color: var(--forest);
  font-size: 11px;
  text-transform: capitalize;
}
.production-filter-summary span {
  color: #7a8379;
  font-size: 9px;
}
.production-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 15px;
}
.production-filter-controls label {
  display: grid;
  gap: 6px;
  min-width: 145px;
}
.production-filter-controls label:first-child { min-width: 190px; }
.production-filter-controls label > span {
  color: #5c665d;
  font-size: 9px;
  font-weight: 800;
}
.production-filter-controls select,
.production-filter-controls input {
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #d7dfd4;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 10px;
  outline: 0;
}
.production-filter-controls select:focus,
.production-filter-controls input:focus {
  border-color: #86a77d;
  box-shadow: 0 0 0 3px rgba(126,166,107,.13);
}
.production-filter-warning {
  margin: 10px 0 0;
  color: #9a433b;
  font-size: 9px;
  font-weight: 700;
}
.chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.chart-scroll .chart {
  min-width: 100%;
}
.chart-scroll .chart.chart-dense {
  min-width: max(100%, 720px);
}
.production-history-table .panel-heading .soft-badge {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .production-filter-panel { padding: 15px; }
  .production-filter-heading { display: grid; gap: 10px; }
  .production-filter-summary { min-width: 0; text-align: left; }
  .production-filter-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .production-filter-controls label,
  .production-filter-controls label:first-child { min-width: 0; }
  .production-filter-controls label:first-child { grid-column: 1 / -1; }
  .production-history-table .panel-heading { align-items: flex-start; }
  .production-history-table .panel-heading .soft-badge { max-width: 44%; }
}

@media (max-width: 440px) {
  .production-filter-controls { grid-template-columns: 1fr; }
  .production-filter-controls label:first-child { grid-column: auto; }
  .production-history-table .panel-heading { display: grid; }
  .production-history-table .panel-heading .soft-badge { max-width: 100%; }
}

@media print {
  .production-filter-panel { padding: 10px 12px !important; border-color: #d9ded6 !important; background: #fff !important; }
  .production-filter-controls, .production-filter-warning { display: none !important; }
  .production-filter-summary { text-align: right !important; }
  .chart-scroll { overflow: visible !important; }
  .chart-scroll .chart.chart-dense { min-width: 100% !important; }
}

/* v21.4 — correção mobile do gráfico de produção e resumo do período */
.production-detail-grid > *,
.production-history-chart,
.chart-scroll {
  min-width: 0;
}

.production-history-chart {
  overflow: hidden;
}

.chart-scroll {
  display: block;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #9bb18f #eef1eb;
}

.chart-scroll::-webkit-scrollbar { height: 7px; }
.chart-scroll::-webkit-scrollbar-track { background: #eef1eb; border-radius: 999px; }
.chart-scroll::-webkit-scrollbar-thumb { background: #9bb18f; border-radius: 999px; }

.chart-scroll-hint {
  display: none;
  margin: 8px 0 0;
  color: #7c857d;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.summary-list > div,
.summary-list > div > span,
.summary-list > div > strong {
  min-width: 0;
}

.summary-list > div > strong {
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  html,
  body,
  .app-shell,
  .main-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .production-detail-grid,
  .production-detail-grid > .panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .production-history-chart .panel-heading {
    min-width: 0;
  }

  .production-history-chart .panel-heading > div {
    min-width: 0;
  }

  .chart-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
  }

  .chart-scroll-hint { display: block; }

  .summary-list > div {
    gap: 14px;
    align-items: flex-start;
  }

  .summary-list > div > span {
    flex: 1 1 45%;
  }

  .summary-list > div > strong {
    flex: 1 1 55%;
    max-width: 55%;
    white-space: normal;
    line-height: 1.35;
  }

  .chart-legend {
    min-width: 0;
    gap: 12px;
  }

  .chart-legend strong {
    text-align: right;
    white-space: nowrap;
  }
}

@media (max-width: 440px) {
  .summary-list > div > strong {
    max-width: 58%;
  }
}

@media print {
  .chart-scroll-hint { display: none !important; }
  .production-history-chart { overflow: visible !important; }
  .chart-scroll { overflow: visible !important; padding-bottom: 0 !important; }
  .chart-scroll .chart { min-width: 100% !important; width: 100% !important; }
}


/* v21.5 — rolagem horizontal do gráfico também na visão geral mobile */
.dashboard-grid > *,
.production-panel {
  min-width: 0;
}

.production-panel {
  overflow: hidden;
}

.overview-chart-scroll {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 720px) {
  .production-panel {
    width: 100%;
    max-width: 100%;
  }

  .overview-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media print {
  .overview-chart-scroll {
    overflow: visible !important;
    padding-bottom: 0 !important;
  }
  .overview-chart-scroll .chart {
    min-width: 100% !important;
    width: 100% !important;
  }
}

/* v21.7 · consultas de histórico reprodutivo, medicinal e visão do animal */
.history-modal-wide { width: min(1040px, 100%); }
.procedure-modal { width: min(860px, 100%); }
.history-filter-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr 1fr; gap: 10px; margin: 4px 0 14px; }
.history-results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 10px; }
.history-table-scroll { max-height: 46vh; border: 1px solid #e6ebe4; border-radius: 14px; }
.history-table-scroll .data-table { margin: 0; }
.history-table-scroll thead th { position: sticky; top: 0; z-index: 2; background: #f7f9f5; }
.history-no-results { margin-top: 12px; }
.procedure-empty { margin-top: 18px; padding: 28px 18px; border: 1px dashed #dce4d8; border-radius: 16px; color: #79817a; background: #fafbf9; text-align: center; font-size: 13px; }
.procedure-animal-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 18px 0 14px; padding: 14px; border: 1px solid #e3e9df; border-radius: 16px; background: #f8faf6; }
.procedure-animal-head > div { min-width: 0; }
.procedure-animal-head strong, .procedure-animal-head small { display: block; }
.procedure-animal-head strong { font-size: 15px; }
.procedure-animal-head small { margin-top: 3px; color: #7a837b; font-size: 12px; }
.procedure-avatar { width: 42px; height: 42px; }
.procedure-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.procedure-metrics article { min-width: 0; padding: 13px; border: 1px solid #e4e9e1; border-radius: 14px; background: #fff; }
.procedure-metrics span, .procedure-metrics strong { display: block; }
.procedure-metrics span { color: #7f8780; font-size: 11px; }
.procedure-metrics strong { margin-top: 5px; color: var(--ink); font-size: 17px; overflow-wrap: anywhere; }
.procedure-heading { margin-top: 22px; }
.procedure-timeline { display: grid; gap: 0; max-height: 48vh; margin-top: 10px; overflow-y: auto; border: 1px solid #e6ebe4; border-radius: 15px; background: #fff; }
.procedure-event { display: grid; grid-template-columns: 105px 92px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid #edf0eb; }
.procedure-event:last-child { border-bottom: 0; }
.procedure-event time { color: #7f8780; font-size: 11px; }
.procedure-type { display: inline-flex; width: fit-content; padding: 5px 7px; border-radius: 8px; font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.procedure-type.reproduction { color: #6e5c1c; background: #f4ebc9; }
.procedure-type.medication { color: #36553e; background: #e5efe1; }
.procedure-event-copy { min-width: 0; }
.procedure-event-copy strong, .procedure-event-copy span { display: block; }
.procedure-event-copy strong { font-size: 13px; }
.procedure-event-copy span { margin-top: 3px; color: #7b837c; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .history-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .procedure-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .procedure-event { grid-template-columns: 88px 82px minmax(0,1fr); }
  .procedure-event > .status-chip { grid-column: 3; justify-self: start; }
}
@media (max-width: 600px) {
  .history-modal-wide, .procedure-modal { width: 100%; }
  .history-filter-grid { grid-template-columns: 1fr; }
  .history-results-bar { align-items: flex-start; flex-direction: column; }
  .history-table-scroll { max-height: 42vh; }
  .procedure-animal-head { grid-template-columns: auto 1fr; }
  .procedure-animal-head > .status-chip { grid-column: 2; justify-self: start; }
  .procedure-metrics { grid-template-columns: 1fr 1fr; }
  .procedure-event { grid-template-columns: 1fr; gap: 6px; }
  .procedure-event > .status-chip { grid-column: auto; justify-self: start; }
  .procedure-timeline { max-height: 46vh; }
}

/* v2.16 · Agenda reprodutiva detalhada */
.repro-rules-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin: -2px 0 18px;
  padding: 12px 14px;
  border: 1px solid #dfe8da;
  border-radius: 14px;
  background: #f8faf6;
}
.repro-rules-strip > div { min-width: 0; }
.repro-rules-strip span,
.repro-rules-strip strong { display: block; }
.repro-rules-strip span {
  color: #7a8379;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.repro-rules-strip strong {
  margin-top: 3px;
  color: #34483a;
  font-size: 12px;
}
.repro-rules-strip a {
  color: var(--forest-2);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.agenda-item-rich {
  grid-template-columns: 35px 110px minmax(90px,1fr) 86px;
  row-gap: 8px;
  padding: 12px 0 13px;
}
.agenda-item-rich .agenda-milestones {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.repro-milestone {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #e4e9e1;
  border-radius: 10px;
  background: #fafbf9;
}
.repro-milestone > span,
.repro-milestone > strong,
.repro-milestone > small { display: block; }
.repro-milestone > span {
  color: #7d857c;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.repro-milestone > strong {
  margin-top: 3px;
  color: #38483c;
  font-size: 11px;
}
.repro-milestone > small {
  margin-top: 2px;
  color: #7c857d;
  font-size: 9px;
}
.repro-milestone.due {
  border-color: #d8c98f;
  background: #fffaf0;
}
.repro-milestone.due > strong,
.repro-milestone.due > small { color: #806719; }
.repro-milestone.overdue {
  border-color: #ebc8c4;
  background: #fff6f4;
}
.repro-milestone.overdue > strong,
.repro-milestone.overdue > small { color: #a14c45; }
.repro-milestone.done {
  border-color: #cfe2c9;
  background: #f2f8ef;
}
.repro-milestone.done > strong,
.repro-milestone.done > small { color: #4a714b; }
.waiting-list > .waiting-item-rich {
  align-items: start;
  padding: 12px;
}
.waiting-copy { min-width: 0; }
.diagnosis-date {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e6e9e3;
  color: #846d2d;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
}
.diagnosis-date.ready { color: #397048; }
.waiting-item-rich.ready { background: #f3f8f0; }
.waiting-item-rich > button { align-self: center; }

@media (max-width: 920px) {
  .repro-rules-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repro-rules-strip a { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .repro-rules-strip { grid-template-columns: 1fr; }
  .repro-rules-strip a { grid-column: auto; }
  .agenda-item-rich { grid-template-columns: 35px minmax(0,1fr) 72px; }
  .agenda-item-rich .agenda-progress { display: none; }
  .agenda-item-rich time { grid-column: 3; grid-row: 1; }
  .agenda-item-rich .agenda-milestones { grid-column: 2 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .agenda-item-rich .agenda-milestones { grid-template-columns: 1fr; }
  .repro-milestone { padding: 9px 10px; }
  .waiting-list > .waiting-item-rich { grid-template-columns: 34px minmax(0,1fr); }
  .waiting-item-rich > button { grid-column: 2; justify-self: start; margin-top: 2px; }
}

/* v2.17 · Reprodução mais limpa */
.repro-rules-strip-compact {
  margin: -2px 0 16px;
  padding: 10px 14px;
}
.repro-rules-strip-compact strong { font-size: 11px; }
.agenda-list-clean { display: grid; gap: 10px; }
.agenda-item-clean {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e2e8df;
  border-radius: 14px;
  background: #fbfcfa;
}
.agenda-item-clean .animal-avatar { margin-top: 2px; }
.agenda-main { min-width: 0; }
.agenda-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.agenda-topline strong,
.agenda-date-block strong,
.agenda-summary-card strong { display: block; }
.agenda-topline small,
.agenda-date-block small,
.agenda-summary-card small { display: block; }
.agenda-date-block {
  min-width: 118px;
  text-align: right;
}
.agenda-date-block span,
.agenda-summary-card span {
  color: #7b837c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.agenda-date-block strong {
  margin-top: 3px;
  font-size: 13px;
  color: #213628;
}
.agenda-date-block small {
  margin-top: 3px;
  font-size: 10px;
  color: #6f786f;
}
.agenda-date-block small.late { color: #a14c45; font-weight: 700; }
.agenda-item-clean .agenda-progress { margin-top: 8px; }
.agenda-summary-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.agenda-summary-card {
  padding: 9px 10px;
  border: 1px solid #e5e9e2;
  border-radius: 12px;
  background: #ffffff;
}
.agenda-summary-card strong {
  margin-top: 4px;
  font-size: 12px;
  color: #2f4335;
}
.agenda-summary-card small {
  margin-top: 3px;
  font-size: 10px;
  color: #748074;
  line-height: 1.35;
}
.agenda-summary-card.ok {
  background: #f2f8ef;
  border-color: #cfe1cb;
}
.agenda-summary-card.ok strong,
.agenda-summary-card.ok small { color: #447047; }
.agenda-summary-card.soon {
  background: #fffaf0;
  border-color: #e6d7a5;
}
.agenda-summary-card.soon strong,
.agenda-summary-card.soon small { color: #7b6519; }
.agenda-summary-card.late {
  background: #fff5f3;
  border-color: #ebc8c4;
}
.agenda-summary-card.late strong,
.agenda-summary-card.late small { color: #a14c45; }
.waiting-list-clean { display: grid; gap: 10px; }
.waiting-item-clean {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5e9e2;
  border-radius: 12px;
  background: #fbfcfa;
}
.waiting-item-clean .waiting-copy small { display: block; }
.diagnosis-date-clean {
  margin-top: 5px;
  padding-top: 0;
  border-top: 0;
  font-size: 10px;
  color: #7a6b38;
}
.diagnosis-date-clean.ready { color: #3f714c; }
@media (max-width: 860px) {
  .agenda-topline { flex-direction: column; }
  .agenda-date-block { min-width: 0; text-align: left; }
}
@media (max-width: 640px) {
  .agenda-summary-grid { grid-template-columns: 1fr; }
  .waiting-item-clean { grid-template-columns: 34px minmax(0, 1fr); }
  .waiting-item-clean > button { grid-column: 2; justify-self: start; }
}

/* v2.18 · Novilhas não possuem secagem antes do primeiro parto */
.agenda-summary-grid.heifer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .agenda-summary-grid.heifer { grid-template-columns: 1fr; }
}

/* v2.19 · identificação de touro / sêmen */
.agenda-sire,
.waiting-sire {
  display: block;
  margin-top: 3px;
  color: #51695a;
  font-size: 10px;
  font-weight: 700;
}

/* v2.21 · Reavaliação de prenhez */
.agenda-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf0eb;
}
.pregnancy-review-button {
  font-size: 11px;
}
.pregnancy-review-effect {
  margin: 12px 0 14px;
  padding: 11px 12px;
  border: 1px solid #ead7a8;
  border-radius: 12px;
  background: #fffaf0;
  color: #705d1f;
  font-size: 12px;
  line-height: 1.45;
}
.pregnancy-review-modal .danger-button {
  min-width: 190px;
}
@media (max-width: 600px) {
  .agenda-card-actions { justify-content: flex-start; }
}

/* v2.22 · ações diretas do protocolo Lactotropin */
.lactotropin-cycle-list > div {
  grid-template-columns: 34px minmax(150px, 1fr) minmax(180px, .95fr) minmax(250px, auto);
}
.lacto-cycle-actions {
  display: grid;
  grid-template-columns: minmax(130px, 150px) auto auto;
  gap: 7px;
  align-items: end;
  justify-content: end;
}
.lacto-cycle-actions label { display: grid; gap: 4px; }
.lacto-cycle-actions label > span {
  color: #7a8379;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.lacto-cycle-actions input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d8e0d4;
  border-radius: 9px;
  background: #fff;
  color: #2e3e31;
  font: inherit;
}
.lacto-action-button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.lacto-action-button:disabled { opacity: .6; cursor: wait; }
.lacto-action-button.done {
  border: 1px solid #abc99f;
  background: #eaf4e6;
  color: #35653c;
}
.lacto-action-button.stop {
  border: 1px solid #e3c9c4;
  background: #fff7f5;
  color: #9b4e47;
}
@media (max-width: 1100px) {
  .lactotropin-cycle-list > div { grid-template-columns: 34px minmax(150px, 1fr) minmax(180px, 1fr); }
  .lacto-cycle-actions { grid-column: 2 / -1; justify-content: start; }
}
@media (max-width: 720px) {
  .lactotropin-cycle-list > div { grid-template-columns: 34px 1fr; }
  .lactotropin-cycle-list .cycle-status,
  .lacto-cycle-actions { grid-column: 2; padding-left: 0; text-align: left; }
  .lacto-cycle-actions { grid-template-columns: 1fr; width: 100%; }
  .lacto-action-button { width: 100%; }
}

/* v2.23 · Lactotropin: escolher ação antes de informar a data */
.lactotropin-cycle-list > div {
  grid-template-columns: 34px minmax(150px, 1fr) minmax(180px, .95fr) minmax(230px, auto);
}
.lacto-cycle-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 230px;
  justify-items: stretch;
}
.lacto-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.lacto-action-button.selected {
  box-shadow: 0 0 0 2px rgba(53,101,60,.08);
}
.lacto-action-button.stop.selected {
  box-shadow: 0 0 0 2px rgba(155,78,71,.08);
}
.lacto-date-confirm {
  display: grid;
  grid-template-columns: minmax(140px, 165px) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid #dfe6dc;
  border-radius: 11px;
  background: #fff;
}
.lacto-date-confirm.reapply {
  border-color: #cfe0c9;
  background: #f7fbf5;
}
.lacto-date-confirm.stop {
  border-color: #ead6d2;
  background: #fff9f7;
}
.lacto-date-confirm label {
  display: grid;
  gap: 4px;
}
.lacto-date-confirm label > span {
  color: #727c72;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.lacto-date-confirm input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d8e0d4;
  border-radius: 9px;
  background: #fff;
  color: #2e3e31;
  font: inherit;
}
.lacto-confirm-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.lacto-cancel-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d8dfd5;
  border-radius: 9px;
  background: #fff;
  color: #657066;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.lacto-cancel-button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 1100px) {
  .lacto-cycle-actions { grid-column: 2 / -1; min-width: 0; }
  .lacto-action-buttons { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .lacto-cycle-actions { grid-column: 2; width: 100%; }
  .lacto-action-buttons { display: grid; grid-template-columns: 1fr; }
  .lacto-date-confirm { grid-template-columns: 1fr; }
  .lacto-confirm-buttons { justify-content: stretch; }
  .lacto-confirm-buttons > button { flex: 1 1 140px; }
}

/* v2.24 · leite fornecido às terneiras */
.calf-milk-table { margin-top: 16px; }
.calf-milk-table .data-table { min-width: 640px; }
@media (max-width: 1180px) {
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
}
