/* PoultraIQ Daily. Palette carried over from the earlier prototype. */
:root {
  --bg: #11130E;
  --panel: #1B1F17;
  --panel-alt: #20241B;
  --border: #2C3223;
  --text: #F1EDE1;
  --muted: #9BA189;
  --faint: #6D7360;
  --accent: #C99A3B;
  --accent-ink: #1A1508;
  --high: #E0694C;
  --high-bg: #2E1B15;
  --medium: #D9A845;
  --medium-bg: #2B2413;
  --low: #A7B48F;
  --good: #8FAE7B;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; margin-top: 1rem; }
p { margin: .25rem 0 .75rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
}
.brand { text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.brand-mark { color: var(--accent); }
.brand-sub { color: var(--muted); font-weight: 600; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav a { color: var(--muted); text-decoration: none; }

main { max-width: 1040px; margin: 0 auto; padding: 1rem; }
.foot { max-width: 1040px; margin: 1rem auto 2rem; padding: 0 1rem; color: var(--faint); font-size: .85rem; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}
.panel.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
details.panel summary { cursor: pointer; color: var(--muted); }
details.panel[open] summary { margin-bottom: .75rem; }

.page-head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 600; margin: 0 0 .25rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.meta { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hint { color: var(--faint); font-weight: 400; font-size: .85em; }
.actions, .row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row input:not([type=checkbox]):not([type=radio]) { flex: 1 1 12rem; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.inline { display: inline; }

label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
label.check { flex-direction: row; align-items: center; gap: .6rem; font-weight: 500; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--panel-alt);
  border: 1px solid var(--border); border-radius: 8px; padding: .65rem .75rem; min-height: 44px;
}
input[type=checkbox], input[type=radio] { min-height: 0; width: 1.3rem; height: 1.3rem; accent-color: var(--accent); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=number] { font-family: var(--mono); font-size: 1.1rem; }
fieldset.choices { border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: .5rem; padding: .75rem; }
fieldset.choices legend { padding: 0 .25rem; font-weight: 600; }
/* minmax(0, …) lets each column shrink below its widest field, so two-column forms fit a phone. */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
.prev { color: var(--faint); font-weight: 400; font-size: .8rem; font-family: var(--mono); }
.field-error { color: var(--high); margin: -.4rem 0 0; font-size: .9rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 8px; padding: .65rem 1rem; min-height: 44px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.button.secondary { background: transparent; color: var(--text); border-color: var(--border); font-weight: 600; }
.button.small { padding: .4rem .75rem; min-height: 38px; font-size: .9rem; }
.button.big { min-height: 52px; font-size: 1.1rem; }
button.link { background: none; border: none; color: var(--muted); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
button.link.danger { color: var(--high); font-size: .85rem; }
.button.danger { border-color: var(--high); color: var(--high); }

.alert { background: var(--high-bg); border: 1px solid var(--high); padding: .6rem .75rem; border-radius: 8px; }
.notice { background: var(--medium-bg); border: 1px solid var(--medium); padding: .6rem .75rem; border-radius: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.card-flagged { border-color: var(--high); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card h2 { margin: 0; }
.card h2 a { color: var(--text); text-decoration: none; }
.status { margin: 0; font-weight: 600; }
.status.ok { color: var(--good); }
.status.warn { color: var(--high); }
.status.todo { color: var(--medium); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); margin-left: .25rem; }
.badge.ok { color: var(--good); border-color: var(--good); }
.badge.warn { color: var(--medium); border-color: var(--medium); }

.flag-list { list-style: none; padding: 0; margin: .25rem 0 .75rem; display: flex; flex-direction: column; gap: .5rem; }
.flag-list li { padding: .6rem .75rem; border-radius: 8px; border-left: 4px solid; background: var(--panel-alt); }
.flag-list.compact li { padding: .4rem .6rem; font-size: .9rem; }
.sev-high { border-color: var(--high); }
.sev-medium { border-color: var(--medium); }
.sev-low { border-color: var(--low); }
td .sev-high { color: var(--high); }
td .sev-medium { color: var(--medium); }
td .sev-low { color: var(--low); }

.list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.list li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.list li.sev-high, .list li.sev-medium, .list li.sev-low { border-left: 4px solid; padding-left: .6rem; }
.list li.sev-high { border-left-color: var(--high); }
.list li.sev-medium { border-left-color: var(--medium); }
.list li.sev-low { border-left-color: var(--low); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .5rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--faint); font-weight: 500; white-space: nowrap; }
td.n, th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }
tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--high); }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
figure { margin: 0; }
figcaption { font-weight: 600; margin-bottom: .25rem; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--border); stroke-dasharray: 3 3; }
svg.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
svg.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; }
svg.chart .baseline { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
svg.chart .dot { fill: var(--accent); }
svg.chart .dot.flagged { fill: var(--high); stroke: var(--text); stroke-width: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.stats div { display: flex; flex-direction: column; background: var(--panel-alt); border-radius: 8px; padding: .6rem .75rem; }
.big-num { font-size: 1.6rem; font-weight: 700; font-family: var(--mono); }
.stats span:last-child { color: var(--muted); font-size: .85rem; }

@media (max-width: 420px) {
  h1 { font-size: 1.5rem; }
  .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; }
}

/* Disease and bird flu warnings stand out from the others. */
.flag-list li.alert { border-left-width: 8px; background: color-mix(in srgb, var(--high) 14%, var(--panel-alt)); }

/* House walk check-ins */
.walks h2 { margin-top: 0; }
.walk { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin: .5rem 0; }
.walk.done { align-items: center; justify-content: space-between; color: var(--good); }
label.compact { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
label.compact input { width: auto; }
.walk-status { display: flex; flex-wrap: wrap; gap: .4rem; }
.walk-chip { font: inherit; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); }
.walk-chip.done { color: var(--good); border-color: var(--good); }
.walk-chip.todo { color: var(--medium); border-color: var(--medium); cursor: pointer; }
details.more { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; }
details.more summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.more[open] summary { margin-bottom: .6rem; }

@media print {
  .topbar, .no-print, nav, form { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border: none; box-shadow: none; padding: 0; }
  table { font-size: 10pt; }
  a { color: inherit; text-decoration: none; }
}

/* Farm switcher: one chip per farm, the current one filled. */
.farm-switch { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.25rem 0 1rem; }
.farm-switch a {
  padding: .35rem .8rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text); text-decoration: none; font-size: .9rem;
}
.farm-switch a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
