:root {
  --ink: #182326;
  --ink-soft: #405154;
  --paper: #f8f6f0;
  --canvas: #edeae0;
  --card: #fffdf8;
  --line: #d8d8cd;
  --amber: #e5a43a;
  --amber-dark: #a76913;
  --aqua: #7bc2be;
  --danger: #a14331;
  --muted: #697779;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
}
.auth-intro {
  background: var(--ink);
  color: #eff2e8;
  padding: clamp(2rem, 7vw, 7rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 570px;
}
.wordmark { display: flex; align-items: center; gap: .7rem; font-weight: 760; font-size: 1.15rem; letter-spacing: -.03em; }
.wordmark-mark {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  color: var(--ink); background: var(--amber); border-radius: .55rem;
  font-size: .76rem; font-weight: 850; letter-spacing: -.08em;
}
.auth-intro h1 { max-width: 11ch; margin: 2rem 0 .9rem; font-size: clamp(2.55rem, 5vw, 4.5rem); letter-spacing: -.065em; line-height: .95; }
.auth-intro p { max-width: 30rem; color: #bfcac3; line-height: 1.6; }
.intro-foot { display: flex; align-items: center; gap: .65rem; color: #bfcac3; font-size: .85rem; }
.intro-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--aqua); }
.auth-panel { display: grid; place-items: center; padding: 2rem; background: var(--paper); }
.auth-card { width: min(100%, 30rem); }
.eyebrow { margin: 0 0 .5rem; color: var(--amber-dark); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.auth-card h2, .workspace-heading h1, .dialog h2 { margin: 0; letter-spacing: -.045em; }
.auth-card h2 { font-size: 2rem; }
.lede { color: var(--muted); line-height: 1.55; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .3rem; margin: 2rem 0 1.5rem; background: #e8e6dc; border-radius: .7rem; }
.auth-switch button { border: 0; border-radius: .48rem; padding: .7rem; color: var(--ink-soft); background: transparent; font-weight: 700; }
.auth-switch button.active { color: var(--ink); background: var(--card); box-shadow: 0 1px 2px #00000014; }
.form-stack { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; color: var(--ink-soft); font-size: .86rem; font-weight: 650; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: .65rem; padding: .75rem .8rem; color: var(--ink); background: var(--card); outline: none; }
input:focus, select:focus { border-color: var(--amber-dark); box-shadow: 0 0 0 3px #e5a43a35; }
.button { border: 0; border-radius: .65rem; min-height: 2.65rem; padding: .65rem 1rem; font-weight: 780; }
.button-primary { color: #fffdf8; background: var(--ink); }
.button-primary:hover { background: #273a3d; }
.button-quiet { color: var(--ink); background: #e8e6dc; }
.form-error { margin: 0; color: var(--danger); font-size: .88rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 17.5rem 1fr; }
.sidebar { background: var(--ink); color: #eff2e8; padding: 1.25rem .9rem; display: flex; flex-direction: column; gap: 2rem; }
.sidebar .wordmark { padding: .35rem .5rem; }
.farm-switcher { width: 100%; border: 1px solid #ffffff24; color: #eff2e8; background: #ffffff10; }
.farm-switcher option { color: var(--ink); background: var(--card); }
.nav { display: grid; gap: .22rem; overflow-y: auto; }
.nav-button { width: 100%; border: 0; border-radius: .55rem; padding: .72rem .7rem; color: #bfcac3; background: transparent; text-align: left; font-size: .9rem; }
.nav-button:hover { color: #fff; background: #ffffff12; }
.nav-button.active { color: var(--ink); background: var(--amber); font-weight: 800; }
.sidebar-footer { margin-top: auto; display: grid; gap: .75rem; padding: .6rem; border-top: 1px solid #ffffff20; }
.user-name { color: #fff; font-size: .9rem; font-weight: 700; }
.role-chip { width: fit-content; padding: .2rem .45rem; color: #bfcac3; border: 1px solid #ffffff25; border-radius: 99px; font-size: .72rem; }
.logout { border: 0; padding: 0; color: #bfcac3; background: none; text-align: left; font-size: .82rem; }
.logout:hover { color: #fff; }

.main { min-width: 0; padding: clamp(1.25rem, 3vw, 3rem); }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.farm-name { margin: 0; font-size: .82rem; color: var(--muted); }
.add-farm { border: 1px solid var(--line); border-radius: .55rem; padding: .55rem .7rem; color: var(--ink); background: var(--card); font-size: .82rem; font-weight: 750; }
.workspace-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.workspace-heading h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.workspace-heading p { margin: .5rem 0 0; color: var(--muted); }
.foundation-note { max-width: 43rem; padding: 1.1rem 1.2rem; border-left: 3px solid var(--amber); background: #fff6e6; color: var(--ink-soft); line-height: 1.55; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.module-card { min-height: 8.5rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--card); }
.module-card h3 { margin: 0; font-size: 1rem; }
.module-card p { margin: .45rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.status { display: inline-block; margin-top: 1rem; padding: .22rem .48rem; color: #59625c; border-radius: 99px; background: #e4e6dc; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.settings-layout { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(18rem, 1.2fr); gap: 1.25rem; margin-top: 2rem; }
.panel { padding: 1.2rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--card); }
.panel h2 { margin: 0; font-size: 1.05rem; }
.panel-description { margin: .5rem 0 1.25rem; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.direction-list { display: grid; gap: .6rem; padding: 0; margin: 0; list-style: none; }
.direction-item { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem; border: 1px solid #e6e5dd; border-radius: .6rem; }
.direction-item small { color: var(--muted); }
.empty { padding: 1rem; border-radius: .6rem; color: var(--muted); background: #f4f2eb; font-size: .88rem; }
.direction-form { display: grid; gap: .9rem; }

.dialog { width: min(calc(100% - 2rem), 31rem); padding: 0; border: 0; border-radius: .95rem; color: var(--ink); background: var(--card); box-shadow: 0 1.5rem 5rem #18232655; }
.dialog::backdrop { background: #18232677; }
.dialog-card { padding: 1.3rem; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading { margin-bottom: 1.3rem; }
.dialog-card label { margin: .9rem 0; }
.icon-button { width: 2rem; height: 2rem; border: 0; border-radius: 50%; color: var(--ink); background: #e8e6dc; font-size: 1.35rem; line-height: 1; }
.dialog-actions { justify-content: flex-end; margin-top: 1.35rem; }

@media (max-width: 760px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; padding: 2rem; }
  .auth-intro h1 { font-size: 2.65rem; }
  .intro-foot { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { gap: 1rem; padding: .8rem; }
  .sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .sidebar .wordmark { padding-left: 0; }
  .farm-switcher { max-width: 13rem; }
  .nav { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .2rem; }
  .nav-button { width: auto; white-space: nowrap; }
  .sidebar-footer { display: none; }
  .main { padding: 1.2rem; }
  .topline { margin-bottom: 1.5rem; }
  .settings-layout { grid-template-columns: 1fr; }
}

/* TozaFerma visual system — restored from the approved light product direction. */
:root {
  --ink: #0c1727;
  --ink-soft: #52617a;
  --paper: #fbfcfe;
  --canvas: #f4f8fc;
  --card: #ffffff;
  --line: #e2e9f1;
  --amber: #fb8248;
  --amber-dark: #df6431;
  --aqua: #93d9c8;
  --danger: #b53f4a;
  --muted: #71809a;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 13% 4%, rgba(255, 211, 184, .38), transparent 24rem),
    radial-gradient(circle at 86% 89%, rgba(206, 234, 255, .64), transparent 29rem),
    var(--canvas);
}

.auth-page {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  padding: 2.25rem 1.25rem;
  background:
    radial-gradient(circle at 11% 7%, rgba(255, 213, 185, .35), transparent 23rem),
    radial-gradient(circle at 87% 92%, rgba(201, 232, 255, .6), transparent 30rem),
    #fbfcfe;
}

.auth-wrap {
  width: min(100%, 29rem);
  margin: auto;
}

.auth-brand,
.wordmark {
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 780;
  letter-spacing: -.045em;
}

.auth-brand {
  margin-bottom: 3.2rem;
  text-align: center;
}

.auth-heading { margin-bottom: 1.7rem; text-align: center; }
.auth-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 5vw, 2.25rem);
  letter-spacing: -.055em;
  line-height: 1.06;
}
.auth-heading p { margin: .65rem 0 0; color: var(--ink-soft); font-size: .96rem; line-height: 1.55; }

.auth-card {
  width: 100%;
  padding: clamp(1.45rem, 5vw, 1.8rem);
  border: 1px solid rgba(219, 227, 236, .95);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1.3rem 3.8rem rgba(31, 56, 85, .1), 0 .15rem .3rem rgba(31, 56, 85, .035);
}

.form-stack { gap: 1.12rem; }
.form-stack label {
  gap: .52rem;
  color: #31445f;
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

input, select {
  min-height: 2.65rem;
  border: 1px solid #dce4ed;
  border-radius: .92rem;
  padding: .72rem .92rem;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(20, 34, 52, .015);
}
input::placeholder { color: #a5b1c1; }
input:focus, select:focus { border-color: #91b7df; box-shadow: 0 0 0 3px rgba(121, 169, 216, .18); }

.button {
  min-height: 2.78rem;
  border-radius: 1rem;
  font-weight: 760;
}
.button-primary { color: #fff; background: #0c1727; box-shadow: 0 .65rem 1.25rem rgba(12, 23, 39, .12); }
.button-primary:hover { background: #16243a; }
.button-quiet { color: #43536b; background: #eff4f8; }
.auth-alternate { margin: 1.22rem 0 0; color: #60708a; text-align: center; font-size: .87rem; }
.auth-link { padding: 0; border: 0; color: var(--amber-dark); background: transparent; font-weight: 760; }
.auth-link:hover { color: #bd4c20; text-decoration: underline; }

.app-shell { min-height: 100vh; grid-template-columns: 15.4rem minmax(0, 1fr); background: transparent; }
.sidebar {
  color: var(--ink);
  border-right: 1px solid #e4ebf2;
  background: rgba(255, 255, 255, .9);
  box-shadow: none;
}
.sidebar .wordmark { padding: .15rem .42rem; }
.sidebar-top { display: grid; gap: 1.25rem; }
.farm-switcher {
  max-width: 100%;
  border-color: #e1e8ef;
  color: #31445f;
  background: #f8fafc;
  font-size: .84rem;
  font-weight: 650;
}
.farm-switcher option { color: var(--ink); background: #fff; }
.farm-menu { position: relative; min-width: 0; }
.farm-menu summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: .9rem; cursor: pointer; list-style: none; overflow-wrap: anywhere; }
.farm-menu summary::-webkit-details-marker { display: none; }
.farm-menu summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.farm-menu-panel { position: absolute; top: calc(100% + .5rem); left: 0; width: max(100%, 15rem); max-width: calc(100vw - 2rem); max-height: 65vh; overflow-y: auto; padding: .5rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); box-shadow: 0 12px 32px #0c172720; z-index: 20; }
.farm-menu-caption { margin: .4rem .5rem; color: var(--muted); font-size: .75rem; }
.farm-menu-option { display: flex; justify-content: space-between; gap: .5rem; width: 100%; padding: .7rem .6rem; border: 0; border-radius: .6rem; background: transparent; color: var(--ink); font: inherit; font-size: .84rem; text-align: left; overflow-wrap: anywhere; }
.farm-menu-option:hover, .farm-menu-option:focus-visible { background: #f4f7fa; }
.farm-menu-option.selected { background: #fff0e8; font-weight: 700; }
.farm-menu-action { margin-top: .5rem; color: var(--amber-dark); }
.nav { gap: .18rem; }
.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: .68rem;
  padding: .67rem .72rem;
  border-radius: .68rem;
  color: #64738b;
  background: transparent;
  font-size: .88rem;
}
.nav-icon { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; color: #8694a8; }
.nav-label { min-width: 0; }
.nav-button:hover { color: var(--ink); background: #f4f7fa; }
.nav-button:hover .nav-icon { color: #51627a; }
.nav-button.active { color: var(--ink); background: #fff0e8; font-weight: 790; }
.nav-button.active .nav-icon { color: var(--amber-dark); }
.nav-button:focus-visible { outline: 3px solid rgba(121, 169, 216, .42); outline-offset: 2px; }
.nav-button.active::before { position: absolute; top: .68rem; bottom: .68rem; left: -.55rem; width: .19rem; border-radius: 9px; background: var(--amber); content: ''; }
.sidebar-footer { border-top-color: #e7edf2; }
.user-name { color: #26384f; }
.role-chip { color: #64748b; border-color: #e1e8ef; background: #f9fbfd; }
.logout { color: #75839a; }
.logout:hover { color: var(--ink); }

.main {
  background:
    radial-gradient(circle at 87% 5%, rgba(255, 220, 201, .38), transparent 23rem),
    radial-gradient(circle at 20% 87%, rgba(211, 237, 255, .42), transparent 28rem),
    #f8fafc;
}
.topline { margin-bottom: 2.2rem; }
.farm-name { color: #7c8ba0; }
.add-farm { border-color: #dce5ed; border-radius: .8rem; padding: .59rem .85rem; color: #31445f; background: rgba(255, 255, 255, .88); box-shadow: 0 .25rem .7rem rgba(31, 56, 85, .04); }
.add-farm:hover { border-color: #b8c8d8; color: var(--ink); }
.workspace-heading h1 { color: var(--ink); letter-spacing: -.055em; }
.workspace-heading p { color: #71809a; }
.eyebrow { color: var(--amber-dark); }
.foundation-note { border-left-color: var(--amber); border-radius: .85rem; color: #4b5d76; background: rgba(255, 247, 241, .92); box-shadow: 0 .2rem .6rem rgba(31, 56, 85, .025); }
.module-card, .panel {
  border-color: #e2e9f1;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 .45rem 1.1rem rgba(31, 56, 85, .045);
}
.module-card h3, .panel h2 { color: var(--ink); }
.module-card p, .panel-description { color: #71809a; }
.status { color: #4e7d71; background: #e8f7f2; }
.direction-item { border-color: #e5ebf1; background: #fff; }
.direction-item small { color: #8090a7; }
.empty { color: #71809a; background: #f4f8fb; }

.dialog { border: 1px solid #e2e9f1; border-radius: 1.15rem; background: #fff; box-shadow: 0 1.5rem 5rem rgba(12, 23, 39, .2); }
.dialog::backdrop { background: rgba(12, 23, 39, .3); backdrop-filter: blur(2px); }
.icon-button { color: #586a82; background: #f1f5f8; }

@media (max-width: 760px) {
  .auth-page { padding: 1.5rem 1rem; }
  .auth-brand { margin-bottom: 2.3rem; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid #e4ebf2; background: rgba(255, 255, 255, .96); }
  .sidebar .wordmark { padding-left: 0; }
  .nav-button.active::before { display: none; }
  .nav-button { gap: .5rem; }
}

textarea {
  width: 100%;
  min-height: 5.8rem;
  resize: vertical;
  border: 1px solid #dce4ed;
  border-radius: .92rem;
  padding: .78rem .92rem;
  color: var(--ink);
  background: #fff;
  outline: none;
}
textarea:focus { border-color: #91b7df; box-shadow: 0 0 0 3px rgba(121, 169, 216, .18); }

.operational-heading { align-items: center; }
.operational-heading .button { white-space: nowrap; }
.records-panel { padding: 1.05rem; }
.records-toolbar {
  display: flex;
  align-items: end;
  gap: .75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #edf1f5;
}
.records-toolbar > label { min-width: 8.8rem; }
.records-toolbar .search-field { flex: 1 1 19rem; }
.records-toolbar label {
  gap: .38rem;
  color: #5e6e86;
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .035em;
}
.records-toolbar input, .records-toolbar select { min-height: 2.5rem; }
.records-content { min-height: 8rem; }
.records-list { display: grid; }
.record-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(11rem, .45fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem .35rem;
  border-bottom: 1px solid #edf1f5;
}
.record-row:last-child { border-bottom: 0; }
.record-main, .record-meta { display: grid; gap: .2rem; }
.record-main strong { color: #17243a; font-size: .93rem; }
.record-main span, .record-meta > span:first-child { color: #71809a; font-size: .82rem; }
.record-meta { justify-items: start; }
.row-action {
  padding: .5rem .65rem;
  border: 1px solid #dfe7ef;
  border-radius: .65rem;
  color: #34455e;
  background: #fff;
  font-size: .78rem;
  font-weight: 720;
}
.row-action:hover { border-color: #bfcddd; color: var(--ink); background: #f8fafc; }
.status-chip {
  display: inline-flex;
  width: fit-content;
  padding: .23rem .48rem;
  border-radius: 99px;
  color: #53766d;
  background: #e9f7f2;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .025em;
}
.status-chip.sold, .status-chip.archived { color: #6e7889; background: #eef2f5; }
.status-chip.deceased { color: #955e61; background: #fff0ef; }
.status-chip.draft { color: #876b40; background: #fff5df; }
.empty-state {
  display: grid;
  gap: .35rem;
  place-items: center;
  min-height: 10.5rem;
  padding: 1.5rem;
  color: #71809a;
  text-align: center;
}
.empty-state strong { color: #34455e; }
.empty-state span { max-width: 27rem; font-size: .88rem; }

.editor-panel {
  margin-top: 1.25rem;
  padding: clamp(1.1rem, 3vw, 1.55rem);
  border: 1px solid #e0e8f0;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 .65rem 1.7rem rgba(31, 56, 85, .055);
}
.editor-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.editor-heading h2 { margin: 0; color: var(--ink); font-size: 1.22rem; letter-spacing: -.03em; }
.editor-heading p:not(.eyebrow) { max-width: 42rem; margin: .42rem 0 0; color: #71809a; font-size: .86rem; line-height: 1.45; }
.editor-close {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #65758d;
  background: #f1f5f8;
  font-size: 1.25rem;
}
.entity-form { display: grid; gap: 1rem; }
.entity-form > label, .form-grid > label, .picker-group > label {
  gap: .46rem;
  color: #40516b;
  font-size: .79rem;
  font-weight: 720;
}
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.editor-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: .25rem; }

#family-editor { position: fixed; inset: 0; margin: auto; width: min(880px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 40px); overflow-y: auto; box-sizing: border-box; color: var(--ink); background: #f7fbfa; }
#family-editor:not([open]) { display: none; }
#family-editor::backdrop { background: rgba(24, 52, 61, .38); backdrop-filter: blur(5px); }
body:has(#family-editor[open]) { overflow: hidden; }
#family-editor .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  #family-editor { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  #family-editor .form-grid, #family-editor .family-composition { grid-template-columns: 1fr; }
  #family-editor .editor-actions { position: sticky; bottom: -18px; background: #f7fbfa; padding: 12px 0; z-index: 2; }
}
#chick-editor { position: fixed; inset: 0; margin: auto; width: min(960px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 40px); overflow-y: auto; box-sizing: border-box; color: var(--ink); background: #f7fbfa; }
#chick-editor:not([open]) { display: none; }
#chick-editor::backdrop { background: rgba(24, 52, 61, .38); backdrop-filter: blur(5px); }
body:has(#chick-editor[open]) { overflow: hidden; }
@media (max-width: 640px) {
  #chick-editor { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  #chick-editor .form-grid { grid-template-columns: 1fr; }
  #chick-editor .editor-actions { position: sticky; bottom: -18px; background: #f7fbfa; padding: 12px 0; z-index: 2; }
}
#chick-editor { width:min(780px,calc(100% - 32px)); padding:28px; }
#chick-editor .eyebrow { display:none; }
#chick-editor .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
#chick-editor [hidden] { display:none!important; }
#chick-editor .editor-heading p:not(.eyebrow) { display:none; }
#chick-editor .chick-source-choice { margin-bottom:4px; }
#chick-editor input, #chick-editor select { border-radius:8px; font-weight:400; }
#chick-editor #chick-manual-origin-field { grid-column:1/-1; }
#chick-editor .chick-composition { padding:16px 0 0; margin:0; border:0; border-top:1px solid #dbe6e6; border-radius:0; background:transparent; }
#chick-editor .chick-composition h3 { display:none; }
#chick-editor .chick-composition-row { display:grid; grid-template-columns:minmax(0,1fr) 120px 30px; gap:12px; align-items:end; margin-bottom:10px; }
#chick-editor .chick-composition-row>button { padding:0; min-width:0; height:44px; border:0; background:none; }
#chick-editor .chick-composition-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; }
#chick-editor [data-add-breed] { border:0; padding-left:0; background:none; color:#117e79; }
#chick-editor [data-breed-total] { font-weight:700; }
#chick-editor .chick-notes summary { cursor:pointer; padding:16px 0; font-weight:600; color:#117e79; list-style:none; border-top:1px solid #dbe6e6; }
#chick-editor .chick-notes summary::before { content:'+ '; }
#chick-editor .chick-notes[open] summary::before { content:'− '; }
#chick-editor .chick-notes summary::-webkit-details-marker { display:none; }
#chick-editor .chick-notes summary span { color:#82949c; font-weight:400; margin-left:8px; }
#chick-editor .editor-actions { border-top:1px solid #dbe6e6; padding-top:16px; }
#chick-editor #cancel-chick { margin-right:auto; background:none; border:0; box-shadow:none; color:#117e79; }
#chick-editor .editor-actions .button-primary { min-width:220px; border-radius:10px; }
@media(max-width:640px){
 #chick-editor { width:100%; padding:18px; }
 #chick-editor .form-grid { grid-template-columns:1fr; }
 #chick-editor .editor-actions .button-primary { min-width:0; flex:1; }
 #chick-editor .chick-composition-row { grid-template-columns:minmax(0,1fr) 75px 26px; gap:8px; }
 #chick-editor .chick-composition-footer { font-size:13px; }
}
.family-toolbar { justify-content: flex-end; }
.family-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .85rem; padding-top: .15rem; }
.family-card {
  display: grid;
  gap: .95rem;
  padding: 1rem;
  border: 1px solid #e6edf3;
  border-radius: .95rem;
  background: #fff;
}
.family-card-top { display: flex; align-items: start; justify-content: space-between; gap: .6rem; }
.family-card h3 { margin: 0; color: #1a2940; font-size: .96rem; }
.family-card p { margin: .25rem 0 0; color: #74829a; font-size: .78rem; }
.family-summary { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 0; }
.family-summary div { min-width: 0; }
.family-summary dt { margin-bottom: .2rem; color: #8a97a9; font-size: .68rem; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.family-summary dd { overflow: hidden; margin: 0; color: #3c4d65; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.family-card .row-action { justify-self: start; }
.family-composition { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: .95rem; }
.picker-group { min-width: 0; }
.field-required { color: var(--amber-dark); }
.bird-picker-shell { position: relative; }
.bird-picker-input { position: relative; }
.bird-picker-input input { padding-right: 2.5rem; }
.picker-clear-query {
  position: absolute;
  top: 50%;
  right: .55rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #6a7b91;
  background: #eef3f7;
  font-size: 1rem;
  line-height: 1;
}
.picker-selected { min-height: 2.1rem; padding-top: .44rem; }
.picker-placeholder { color: #98a6b7; font-size: .76rem; }
.picker-choice { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .6rem; border: 1px solid #dce9e7; border-radius: .68rem; background: #f5fbf9; }
.picker-choice span { display: grid; min-width: 0; gap: .1rem; }
.picker-choice strong { overflow: hidden; color: #314a49; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.picker-choice small { overflow: hidden; color: #718484; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.picker-choice button { flex: 0 0 auto; border: 0; color: #64827c; background: transparent; font-size: 1.1rem; }
.picker-multi-summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: #405b58; font-size: .78rem; }
.picker-multi-summary button { border: 0; padding: 0; color: var(--amber-dark); background: transparent; font-size: .74rem; font-weight: 700; }
.picker-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.picker-chip, .picker-more { display: inline-flex; align-items: center; gap: .22rem; padding: .25rem .42rem; border: 1px solid #dce9e7; border-radius: 99px; color: #526f6a; background: #f5fbf9; font-size: .69rem; }
.picker-chip span { color: #788f8b; font-size: .88rem; line-height: .6; }
.picker-more { color: #71809a; border-color: #e3e9ef; background: #f7f9fb; }
.picker-dropdown {
  position: absolute;
  z-index: 10;
  right: 0;
  left: 0;
  max-height: 17rem;
  overflow-y: auto;
  margin-top: .35rem;
  padding: .32rem;
  border: 1px solid #dce5ed;
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 .9rem 2.2rem rgba(31, 56, 85, .16);
}
.picker-result { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .7rem; padding: .62rem .65rem; border: 0; border-radius: .58rem; color: #34465e; background: transparent; text-align: left; }
.picker-result:hover, .picker-result.is-selected { background: #f2f8fb; }
.picker-result span { display: grid; min-width: 0; gap: .12rem; }
.picker-result strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.picker-result small { overflow: hidden; color: #77879b; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.picker-result em { flex: 0 0 auto; color: #c56639; font-size: .67rem; font-style: normal; font-weight: 760; }
.picker-empty { padding: .76rem; color: #7c8b9e; font-size: .78rem; text-align: center; }

.field-optional { color: #8a98aa; font-size: .68rem; font-weight: 600; }
.field-hint { display: block; min-height: 1rem; margin-top: .34rem; color: #7c8b9e; font-size: .7rem; font-weight: 500; line-height: 1.35; }
input.is-derived { border-color: #d6e7df; color: #405d57; background: #f5fbf8; }
.egg-toolbar { align-items: center; min-height: 2.3rem; }
.toolbar-note { flex: 1; margin: 0; color: #74839a; font-size: .8rem; line-height: 1.4; }
.record-caption { color: #8a97a9; font-size: .72rem; }
.chick-toolbar { justify-content: space-between; align-items: center; }
.chick-source-summary { padding: .72rem .82rem; border: 1px solid #e2ebf2; border-radius: .78rem; color: #63748c; background: #f7fafc; font-size: .8rem; line-height: 1.45; }

.incubation-toolbar { justify-content: space-between; align-items: center; }
.incubation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: .9rem; padding-top: .1rem; }
.incubation-card { display: grid; gap: .9rem; padding: 1rem; border: 1px solid #e4ebf2; border-radius: 1rem; background: #fff; box-shadow: 0 .3rem .8rem rgba(31, 56, 85, .025); }
.incubation-card-top { display: flex; align-items: start; justify-content: space-between; gap: .65rem; }
.incubation-card-top h3 { margin: .16rem 0 0; color: #1a2940; font-size: 1rem; }
.incubation-card-top p:not(.eyebrow) { margin: .3rem 0 0; color: #74829a; font-size: .76rem; line-height: 1.4; }
.incubation-card-top .eyebrow { margin: 0; font-size: .65rem; }
.incubation-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.incubation-stats > div { display: grid; gap: .24rem; min-width: 0; padding: .58rem .5rem; border: 1px solid #edf1f5; border-radius: .68rem; background: #fbfcfd; }
.incubation-stats span { overflow: hidden; color: #8794a6; font-size: .62rem; font-weight: 730; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.incubation-stats strong { color: #34465e; font-size: .91rem; }
.incubation-stats .unfertilized-stat { border-color: #f2dfd3; background: #fff8f3; }
.incubation-stats .unfertilized-stat strong { color: #b85f39; }
.incubation-note { margin: 0; color: #75849a; font-size: .76rem; line-height: 1.45; }
.candling-summary { display: grid; gap: .55rem; padding-top: .82rem; border-top: 1px solid #edf1f5; }
.candling-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.candling-summary h4 { margin: 0; color: #506078; font-size: .76rem; letter-spacing: .02em; text-transform: uppercase; }
.candling-empty { color: #8a97a9; font-size: .76rem; }
.candling-history { display: grid; gap: .42rem; }
.candling-history-row { display: flex; align-items: start; justify-content: space-between; gap: .6rem; padding: .46rem .52rem; border-radius: .58rem; background: #f7fafc; }
.candling-history-row div { display: grid; gap: .15rem; min-width: 0; }
.candling-history-row strong { color: #4a5b72; font-size: .75rem; }
.candling-history-row span { color: #79889d; font-size: .7rem; line-height: 1.35; }
.text-action { border: 0; padding: 0; color: var(--amber-dark); background: transparent; font-size: .73rem; font-weight: 740; white-space: nowrap; }
.text-action:hover { color: #a34e2d; text-decoration: underline; }
.incubation-card-actions { display: flex; justify-content: flex-end; }
.status-chip.completed { color: #516f9f; background: #edf4ff; }
.status-chip.cancelled { color: #7b8390; background: #f1f3f5; }
.status-chip.transferred { color: #7661a0; background: #f2effa; }
.status-chip.sold { color: #9a6a38; background: #fff4e7; }
.candling-panel { border-color: #dce9e7; }
.candling-balance { min-height: 1.2rem; margin: -.2rem 0 0; color: #60718a; font-size: .78rem; }

.health-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.health-tabs { display: flex; gap: .35rem; width: fit-content; max-width: 100%; margin: 0 0 1rem; padding: .3rem; border: 1px solid #e1e9f0; border-radius: .85rem; background: rgba(255, 255, 255, .72); }
.health-tab { border: 0; border-radius: .58rem; padding: .58rem .78rem; color: #64748b; background: transparent; font-size: .8rem; font-weight: 740; white-space: nowrap; }
.health-tab:hover { color: #26384f; background: #f5f8fb; }
.health-tab.active { color: #243b5c; background: #edf4ff; box-shadow: 0 .12rem .35rem rgba(52, 88, 133, .08); }
.health-toolbar { flex-wrap: wrap; align-items: end; }
.health-toolbar > label { flex: 0 1 10.3rem; min-width: min(100%, 9rem); }
.vaccination-toolbar .toolbar-note { flex: 1 1 16rem; padding-bottom: .08rem; }
.health-row-actions { display: flex; justify-content: flex-end; gap: .42rem; }
.health-complete-action { color: #315f52; border-color: #cfe9df; background: #f4fbf8; }
.health-complete-action:hover { border-color: #a9d5c6; color: #204a3e; background: #ebf8f3; }
.health-condition.healthy, .vaccination-due.completed { color: #3f7667; background: #e8f7f1; }
.health-condition.observation, .vaccination-due.upcoming { color: #496d9e; background: #edf4ff; }
.health-condition.sick, .vaccination-due.overdue { color: #a64b50; background: #fff0ef; }
.health-condition.recovered { color: #5a7a50; background: #eff8e9; }
.vaccination-due.today { color: #9c5b29; background: #fff4e5; }
.vaccination-due.cancelled { color: #737f8f; background: #f0f3f6; }

.health-subject-controller { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; padding: .95rem; border: 1px solid #e3ebf2; border-radius: .95rem; background: #f9fbfd; }
.health-subject-controller > label, .health-subject-field { min-width: 0; }
.health-subject-field label { display: grid; gap: .46rem; }
.health-subject-controller .field-hint { max-width: 31rem; }
.health-subject-locked { grid-column: 1 / -1; display: grid; gap: .18rem; padding: .72rem .8rem; border: 1px solid #dce9e7; border-radius: .75rem; color: #496059; background: #f4faf8; }
.health-subject-locked strong { color: #315248; font-size: .78rem; }
.health-subject-locked span { color: #526f69; font-size: .84rem; font-weight: 700; }
.health-subject-locked small { color: #71868a; font-size: .71rem; line-height: 1.35; }
.health-clinical-fields { align-items: start; }
.health-wide-field { grid-column: span 2; }
.health-plan-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.health-completion-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.health-cancel-plan { color: #955359; background: #fff0ef; }
.health-cancel-plan:hover { color: #7e3f45; background: #ffe8e5; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incubation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-subject-controller { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-plan-form-grid, .health-completion-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .operational-heading { align-items: start; }
  .records-toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .records-toolbar .search-field { grid-column: 1 / -1; }
  .record-row { grid-template-columns: 1fr auto; }
  .record-meta { grid-column: 1; grid-row: 2; grid-auto-flow: column; justify-content: start; }
  .record-row .row-action { grid-column: 2; grid-row: 1 / span 2; }
  .form-grid, .family-composition { grid-template-columns: 1fr; }
  .incubation-toolbar { display: grid; grid-template-columns: 1fr; align-items: start; }
  .chick-toolbar { display: grid; grid-template-columns: 1fr; align-items: start; }
  .incubation-grid { grid-template-columns: 1fr; }
  .editor-actions { flex-direction: column-reverse; }
  .editor-actions .button { width: 100%; }
  .health-heading-actions { width: 100%; justify-content: stretch; }
  .health-heading-actions .button { flex: 1; }
  .health-tabs { width: 100%; overflow-x: auto; }
  .health-tab { flex: 1 0 auto; }
  .health-toolbar { grid-template-columns: 1fr; }
  .health-toolbar > label { min-width: 0; }
  .health-row-actions { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
  .health-row-actions .row-action { width: 100%; }
  .health-subject-controller, .health-plan-form-grid, .health-completion-form-grid { grid-template-columns: 1fr; }
  .health-wide-field { grid-column: auto; }
}

/* Farm management modules */
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.metric-card { display: grid; gap: .34rem; min-width: 0; padding: .92rem; border: 1px solid #e5ecf2; border-radius: .95rem; background: #fff; box-shadow: 0 .3rem .8rem rgba(31, 56, 85, .025); }
.metric-card > span { color: #7c8b9e; font-size: .69rem; font-weight: 760; letter-spacing: .035em; text-transform: uppercase; }
.metric-card > strong { overflow: hidden; color: #26384f; font-size: 1rem; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > small { overflow: hidden; color: #7b899c; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.metric-card.metric-income { border-color: #d7ece3; background: #fcfffd; }
.metric-card.metric-income > strong { color: #386c5e; }
.metric-card.metric-warning { border-color: #f0dfd3; background: #fffdfb; }
.metric-card.metric-warning > strong { color: #a65a3f; }
.overview-controls, .finance-controls, .report-period { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; }
.overview-controls > div:first-child { display: grid; gap: .18rem; }
.overview-controls span { color: #75849a; font-size: .77rem; }
.period-fields { display: flex; align-items: end; gap: .5rem; }
.period-fields label { display: grid; gap: .24rem; color: #687890; font-size: .67rem; font-weight: 750; }
.period-fields input { width: 8.4rem; min-height: 2.25rem; padding: .35rem .48rem; }
.overview-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.overview-split .panel { min-width: 0; }
.overview-split h2, .panel h2, .sales-lines-heading h3, .movement-history h3, .customer-orders h3, .order-detail-grid h3 { margin: 0; color: #32445c; font-size: .91rem; }
.insight-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .85rem; }
.insight-list > div { display: grid; gap: .25rem; padding: .7rem; border-radius: .72rem; background: #f7fafc; }
.insight-list strong { color: #2f496b; font-size: 1rem; }
.insight-list span { color: #74839a; font-size: .7rem; line-height: 1.3; }
.summary-rows { display: grid; gap: .1rem; margin-top: .7rem; }
.summary-rows > div { display: flex; justify-content: space-between; gap: .9rem; padding: .63rem 0; border-bottom: 1px solid #edf1f5; }
.summary-rows > div:last-child { border-bottom: 0; }
.summary-rows span { min-width: 0; color: #708099; font-size: .77rem; line-height: 1.35; }
.summary-rows strong { flex: 0 0 auto; color: #35485f; font-size: .77rem; text-align: right; }
.compact-empty { min-height: 5.5rem; }
.locked-note { margin: .85rem 0; padding: .68rem .75rem; border: 1px solid #eee3cf; border-radius: .72rem; color: #7f6944; background: #fffbf2; font-size: .77rem; line-height: 1.4; }
.muted-text { margin: .7rem 0; color: #7c8b9e; font-size: .78rem; }

.record-open, .order-open { display: flex; width: 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 1rem; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.record-open:hover .record-main strong, .order-open:hover > span:first-child strong { color: #b65b36; }
.feed-record-row, .customer-record-row, .finance-record-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.feed-quantity, .customer-debt, .finance-amount { display: grid; justify-items: end; gap: .18rem; white-space: nowrap; }
.feed-quantity strong, .customer-debt strong, .finance-amount strong { color: #344c68; font-size: .83rem; }
.feed-quantity small, .customer-debt small, .finance-amount small { color: #8290a3; font-size: .66rem; }
.feed-quantity.is-low strong { color: #a75c40; }
.feed-quantity.is-low small { color: #ad6245; font-weight: 720; }
.feed-detail { border-color: #dbe8ef; }
.movement-form { margin: .9rem 0; padding: .9rem; border: 1px solid #e5edf3; border-radius: .9rem; background: #fafcfd; }
.movement-history { margin-top: 1.2rem; }
.amount-income { color: #397968 !important; }
.amount-expense { color: #a5544d !important; }

.module-tabs { display: flex; width: fit-content; max-width: 100%; gap: .25rem; padding: .25rem; border: 1px solid #e1e9f0; border-radius: .82rem; background: rgba(255,255,255,.78); }
.module-tab { border: 0; border-radius: .58rem; padding: .52rem .74rem; color: #65758c; background: transparent; font-size: .78rem; font-weight: 740; white-space: nowrap; }
.module-tab:hover { color: #33485f; background: #f5f8fb; }
.module-tab.active { color: #2d4c70; background: #edf4ff; box-shadow: 0 .1rem .3rem rgba(52, 88, 133, .08); }
.sales-toolbar { min-height: 2.2rem; }
.order-composer { margin-top: 1.25rem; border-color: #dce8ef; }
.order-customer-block { display: grid; gap: .5rem; padding: .85rem; border: 1px solid #e2eaf1; border-radius: .9rem; background: #fbfcfd; }
.customer-search-label { display: grid; gap: .42rem; color: #40516b; font-size: .78rem; font-weight: 720; }
.customer-search-results { display: grid; gap: .22rem; max-height: 12rem; overflow-y: auto; }
.customer-search-results > span { padding: .32rem; color: #8290a3; font-size: .75rem; }
.customer-search-results button { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .58rem .65rem; border: 1px solid #e2eaf1; border-radius: .62rem; color: #34495f; background: #fff; text-align: left; }
.customer-search-results button:hover { border-color: #c6d6e5; background: #f7fbfe; }
.customer-search-results button strong { font-size: .77rem; }
.customer-search-results button span { color: #7a899d; font-size: .7rem; }
.selected-customer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .45rem .8rem; padding: .2rem; }
.selected-customer > span { color: #8090a4; font-size: .69rem; font-weight: 760; text-transform: uppercase; }
.selected-customer strong { color: #31485e; font-size: .85rem; }
.selected-customer small { grid-column: 2; color: #74859b; font-size: .72rem; }
.selected-customer button { grid-column: 3; grid-row: 1 / span 2; border: 0; padding: .22rem; color: var(--amber-dark); background: transparent; font-size: .72rem; font-weight: 720; }
.quick-customer { display: grid; gap: .75rem; padding: .85rem; border: 1px solid #eedfd0; border-radius: .9rem; background: #fffaf6; }
.quick-customer > div:first-child { display: grid; gap: .18rem; }
.quick-customer strong { color: #7a4d38; font-size: .82rem; }
.quick-customer span { color: #8d745f; font-size: .72rem; }
.sales-lines-section { display: grid; gap: .75rem; }
.sales-lines-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
.sales-lines-heading p { margin: .22rem 0 0; color: #7b899d; font-size: .74rem; line-height: 1.35; }
.sales-lines { display: grid; gap: .65rem; }
.sales-line { position: relative; padding: .85rem; border: 1px solid #e5ecf2; border-radius: .9rem; background: #fbfcfd; }
.sales-line-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; align-items: end; padding-right: 1.6rem; }
.sales-line-grid label { display: grid; gap: .36rem; color: #4b5c72; font-size: .7rem; font-weight: 720; }
.line-total { display: grid; gap: .24rem; padding: .47rem .55rem; border-radius: .65rem; background: #eef5fb; }
.line-total span { color: #728299; font-size: .66rem; }
.line-total strong { color: #355777; font-size: .78rem; }
.line-remove { position: absolute; top: .5rem; right: .52rem; width: 1.45rem; height: 1.45rem; border: 0; border-radius: 50%; color: #8a6d73; background: #f4eeee; font-size: 1rem; line-height: 1; }
.line-remove:hover { color: #8b4147; background: #ffe9e7; }
.order-total { display: flex; justify-content: flex-end; gap: .6rem; align-items: center; padding: .75rem .85rem; border-radius: .8rem; color: #506078; background: #f3f7fa; }
.order-total strong { color: #284a70; font-size: 1rem; }
.order-records { gap: 0; }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; padding: .9rem .35rem; border-bottom: 1px solid #edf1f5; }
.order-row:last-child { border-bottom: 0; }
.order-open > span:first-child, .order-money { display: grid; min-width: 0; gap: .2rem; }
.order-open > span:first-child strong { overflow: hidden; color: #34485e; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.order-open > span:first-child small, .order-money small { overflow: hidden; color: #7d8b9e; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.order-money { justify-items: end; }
.order-money strong { color: #35516d; font-size: .8rem; }
.order-statuses { display: grid; gap: .26rem; justify-items: end; }
.payment-chip { display: inline-flex; width: fit-content; padding: .2rem .42rem; border-radius: 99px; color: #8c7144; background: #fff6e7; font-size: .64rem; font-weight: 760; }
.payment-chip.paid { color: #397568; background: #e9f7f1; }
.payment-chip.partial { color: #4a6e9b; background: #edf4ff; }
.sales-detail, .customer-detail { margin-top: 1.25rem; }
.order-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.order-detail-grid section { min-width: 0; padding: .8rem; border: 1px solid #e8eef3; border-radius: .85rem; background: #fbfcfd; }
.order-detail-total { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem 1rem; margin: 1rem 0; padding: .75rem; border-radius: .75rem; background: #f3f7fa; color: #65758c; font-size: .78rem; }
.order-detail-total strong { color: #2f4b69; }
.payment-form { margin: .9rem 0; padding: .9rem; border: 1px solid #dce9e7; border-radius: .9rem; background: #f7fcfa; }
.payment-form h3 { margin: 0 0 .7rem; color: #3f635b; font-size: .86rem; }

.customer-detail-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.customer-orders { margin-top: 1rem; }
.customer-orders > h3 { margin-bottom: .65rem; }
.nested-editor { margin-top: 1rem; }
.inline-category-form, .inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid #edf1f5; }
.inline-category-form > label, .inline-form > label { display: grid; flex: 1 1 10rem; gap: .35rem; color: #4b5c72; font-size: .72rem; font-weight: 720; }
.inline-form .form-error, .inline-category-form .form-error { flex-basis: 100%; margin: 0; }
.category-add-action { display: block; margin-top: .35rem; }
.finance-record-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.billing-summary { display: grid; gap: .5rem; padding: .85rem; border: 1px solid #dfe9f0; border-radius: .82rem; background: #fbfcfd; }
.billing-summary strong { color: #364b63; font-size: .82rem; }
.billing-summary small { color: #7b8a9d; font-size: .73rem; line-height: 1.4; }

.settings-sections { display: grid; gap: 1rem; }
.panel-heading { display: flex; justify-content: space-between; gap: .8rem; }
.panel-heading p { margin: .3rem 0 0; color: #77869a; font-size: .77rem; line-height: 1.4; }
.member-role-control select { min-width: 8.5rem; }
.member-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.invite-history { display: grid; gap: .3rem; margin-top: .9rem; }
.invite-history h3 { margin: 0 0 .2rem; color: #52627a; font-size: .78rem; text-transform: uppercase; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid #edf1f5; }
.invite-row span { display: grid; gap: .16rem; min-width: 0; }
.invite-row strong { color: #3a4e66; font-size: .77rem; }
.invite-row small { color: #7b8a9e; font-size: .69rem; }
.invite-token { display: grid; gap: .3rem; margin: .8rem 0; padding: .75rem; border: 1px solid #d8e9e2; border-radius: .78rem; color: #49665f; background: #f5fbf8; font-size: .76rem; }
.invite-token code { padding: .1rem .26rem; border-radius: .3rem; color: #2d554a; background: #e7f4ee; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.invite-token small { color: #789089; font-size: .68rem; }

.batch-sources { display: grid; gap: .5rem; padding-top: .15rem; }
.batch-sources h4 { margin: 0; color: #5d6d82; font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; }
.incubation-source-list { display: grid; gap: .42rem; }
.incubation-source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; padding: .62rem .68rem; border: 1px solid #e8eef3; border-radius: .72rem; background: #fbfcfd; }
.incubation-source-row > div:first-child { display: grid; min-width: 0; gap: .16rem; }
.incubation-source-row strong { overflow: hidden; color: #43566c; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.incubation-source-row small { overflow: hidden; color: #8290a3; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.source-type { width: fit-content; padding: .15rem .35rem; border-radius: 99px; color: #55728c; background: #edf4fb; font-size: .61rem; font-weight: 780; }
.source-quantity { display: grid; justify-items: end; gap: .12rem; white-space: nowrap; }
.source-quantity strong { color: #345a7a; }
.source-actions { display: flex; gap: .4rem; }
.danger-action { color: #a65351; }
.source-builder { display: grid; gap: .8rem; padding: 1rem; border: 1px solid #dee8ef; border-radius: .95rem; background: #fbfcfd; }
.source-edit-wrap { display: grid; gap: .7rem; padding: .85rem; border: 1px dashed #cfdae6; border-radius: .78rem; background: #fff; }
.source-mode-row { display: flex; align-items: end; gap: .7rem; }
.source-mode-row label { display: grid; flex: 1; gap: .36rem; color: #4a5c73; font-size: .72rem; font-weight: 720; }
.source-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.incubation-main-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sales-line-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .overview-split, .order-detail-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-line-grid, .source-form-grid, .incubation-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-controls, .finance-controls, .report-period { align-items: stretch; flex-direction: column; }
  .period-fields { flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .metric-card { padding: .72rem; }
  .metric-card > strong { font-size: .86rem; }
  .insight-list { grid-template-columns: 1fr; }
  .module-tabs { width: 100%; overflow-x: auto; }
  .module-tab { flex: 1 0 auto; }
  .feed-record-row, .customer-record-row, .finance-record-row, .member-row, .order-row { grid-template-columns: 1fr auto; }
  .feed-record-row .row-action, .customer-record-row .row-action, .finance-record-row .row-action, .member-row .row-action, .order-row .row-action { grid-column: 2; grid-row: 1 / span 2; }
  .feed-quantity, .customer-debt, .finance-amount, .order-statuses { grid-column: 1; justify-items: start; grid-auto-flow: column; justify-content: start; }
  .sales-line-grid, .source-form-grid, .incubation-main-grid { grid-template-columns: 1fr; }
  .sales-lines-heading, .source-mode-row { align-items: stretch; flex-direction: column; }
  .source-mode-row .button { width: 100%; }
  .incubation-source-row { grid-template-columns: minmax(0, 1fr) auto; }
  .source-actions { grid-column: 1 / -1; }
  .order-detail-total { justify-content: start; flex-direction: column; gap: .35rem; }
  .period-fields { display: grid; grid-template-columns: 1fr 1fr; }
  .period-fields .button { grid-column: 1 / -1; }
  .period-fields input { width: 100%; }
  .selected-customer { grid-template-columns: 1fr auto; }
  .selected-customer small { grid-column: 1; }
  .selected-customer button { grid-column: 2; grid-row: 1 / span 2; }
}
:root { --inc-border: #d4e5e5; }
.inc-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:14px; margin:20px 0; }
.inc-metric { display:flex; flex-direction:column; gap:9px; padding:20px; border:1px solid white; border-radius:22px; background:rgba(255,255,255,.78); box-shadow:0 8px 25px #123a4210; }
.inc-metric>span { font-size:12px; color:#557382; }
.inc-metric>strong { font-size:24px; line-height:1.2; }
.inc-metric>small,.inc-source small,.inc-batch-row small,.inc-timeline small { display:block; color:#63818f; font-size:12px; margin-top:5px; }
.inc-batch-row { width:100%; border:0; border-bottom:1px solid var(--inc-border); padding:20px 4px; display:flex; align-items:center; justify-content:space-between; text-align:left; color:inherit; background:transparent; cursor:pointer; gap:14px; font:inherit; }
.inc-batch-row:hover { background:#e9f6f380; }
.inc-batch-row>span:first-child { flex:1; }
.inc-batch-row progress,.inc-progress progress,.inc-wizard-progress { display:block; width:100%; height:6px; margin-top:12px; border:0; border-radius:10px; overflow:hidden; accent-color:#148e84; background:#e5efed; }
progress::-webkit-progress-bar { background:#e5efed; border-radius:10px; }
progress::-webkit-progress-value { background:#168e84; border-radius:10px; }
.inc-detail-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:16px; }
.inc-detail-heading h1 { font-size:28px; margin:0; }
.inc-progress { margin:16px 0; padding:18px 24px; font-size:13px; }
.inc-detail-grid { display:grid; grid-template-columns:minmax(240px,.85fr) minmax(300px,1.4fr); gap:18px; }
.inc-detail-grid .panel { margin-bottom:18px; }
.inc-source { padding:16px; margin:12px 0; border:1px solid var(--inc-border); border-radius:18px; overflow-wrap:anywhere; }
.inc-source summary { cursor:pointer; font-weight:600; }
.inc-source-draft { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.inc-actions { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
.inc-timeline { border-left:2px solid #b5dcd6; padding:8px 16px; margin:8px 0; font-size:14px; }
.inc-dialog { width:min(560px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; margin:0 0 0 auto; padding:24px; border:1px solid #ffffff; border-radius:24px 0 0 24px; background:linear-gradient(130deg,#f3faf8,#fffaf6); color:#123440; box-shadow:-10px 0 60px #12344026; overflow:auto; }
.inc-dialog::backdrop { background:#13353966; backdrop-filter:blur(3px); }
.inc-dialog-wide { width:min(960px,calc(100vw - 32px)); height:auto; max-height:92dvh; margin:auto; border-radius:26px; }
.inc-dialog-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.inc-dialog-heading h2 { margin:0; font-size:23px; }
.inc-dialog .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.inc-dialog label { min-width:0; }
.inc-dialog input,.inc-dialog select,.inc-dialog textarea { width:100%; box-sizing:border-box; }
.inc-dialog .editor-actions { position:sticky; bottom:-24px; background:#f4faf8; padding:16px 0; margin-top:14px; border-top:1px solid var(--inc-border); }
.inc-dialog .inc-source .form-grid { margin-top:16px; }
.inc-wizard-progress { margin-bottom:24px; }
.inc-equipment-card { text-align:left; color:inherit; font:inherit; cursor:pointer; }
.inc-equipment-card:hover { background:#e6f7f2; }
.inc-equipment-card>strong { font-size:18px; }
.inc-equipment-card progress { width:100%; accent-color:#168e84; }
.inc-dialog .inc-capacity-confirm { display:flex; flex-direction:row; align-items:flex-start; gap:10px; font-size:12px; }
.inc-dialog .inc-capacity-confirm input { width:18px; height:18px; flex:0 0 18px; margin:0; }
@media(max-width:700px) {
  .inc-detail-grid { grid-template-columns:1fr; }
  .inc-detail-heading { align-items:flex-start; flex-direction:column; }
  .inc-dialog { padding:18px; border-radius:0; }
  .inc-dialog-wide { width:100vw; max-height:100dvh; height:100dvh; }
  .inc-dialog .form-grid { grid-template-columns:1fr; }
  .inc-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.chick-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.chick-metric { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:20px; border:1px solid #dce9e7; border-radius:22px; background:linear-gradient(135deg,#ffffffed,#eff9f6b0); box-shadow:0 8px 22px #244d4810; }
.chick-metric > span:not(.chick-metric-icon) { font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:#577e82; }
.chick-metric strong { font-size:25px; line-height:1.15; color:#153c46; }
.chick-metric small { font-size:11px; color:#739096; }
.chick-metric-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:12px; background:#ddf4ed; color:#138d83; }
.chick-metric-icon svg { width:18px; height:18px; }
.chick-metric:nth-child(2) .chick-metric-icon { background:#e2f2fa; color:#3589ac; }
.chick-metric:nth-child(4) .chick-metric-icon { background:#fff0e1; color:#bd7851; }
.chick-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:16px; border:1px solid #dce9e7; border-radius:20px; background:#ffffffa8; margin-bottom:16px; }
.chick-toolbar label { flex:1 1 150px; }
.chick-toolbar label:first-child { flex:2 1 230px; }
.chick-toolbar .toolbar-note { flex-basis:100%; margin:0; font-size:12px; }
#chick-results { border:1px solid #dce9e7; border-radius:22px; padding:16px; background:#ffffffa8; }
#chick-results .empty { min-height:210px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; }
.chick-record-row { padding:18px 8px; }
@media(max-width:800px) { .chick-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .chick-metric { padding:14px; } }
.chick-record-row[role="button"] { cursor:pointer; grid-template-columns:minmax(0,1fr) auto; border-radius:16px; transition:background .15s; }
.chick-record-row[role="button"]:hover { background:#eaf7f3; }
.chick-record-row[role="button"]:focus-visible { outline:2px solid #168c83; outline-offset:3px; }
.growing-page { width:calc(100vw - 48px)!important; max-width:1200px!important; min-height:0!important; height:auto!important; max-height:94vh; padding:28px!important; }
.growing-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.growing-workspace { margin-top:28px; border-top:1px solid #dce9e7; padding-top:20px; }
@media(max-width:700px){ .growing-grid { grid-template-columns:1fr; } .growing-page { width:calc(100vw - 16px)!important; padding:18px!important; } }
.ring-entry { position:relative; padding-top:42px!important; }
.ring-entry-remove { position:absolute; top:10px; right:10px; width:28px; height:28px; padding:0; border:0; border-radius:50%; background:#e6f1ef; color:#426e73; font-size:20px; cursor:pointer; }
.ring-entry-remove:hover { background:#d0e7e2; }
.adult-table-wrap { overflow-x:auto; border:1px solid #dce9e7; border-radius:20px; }
.adult-table { width:100%; border-collapse:collapse; text-align:left; background:#ffffffa8; }
.adult-table th { padding:16px; font-size:11px; font-weight:500; color:#638088; background:#eef7f5; white-space:nowrap; }
.adult-table td { padding:17px 16px; border-top:1px solid #dce9e7; font-size:13px; }
.adult-table tbody tr:hover { background:#edf8f5; }
.adult-table .record-open { color:#127f79; font-weight:700; white-space:nowrap; }
.adult-table .row-action { min-width:34px; }
.adult-breeds { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 18px; font-size:12px; color:#638088; }
.dashboard-main-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.dashboard-health-heading { margin-top:28px; align-items:center; }
.dashboard-health-heading h2 { font-size:18px; }
.dashboard-events { margin-top:16px; }
.dashboard-events .empty-state { min-height:120px; align-items:center; text-align:center; }
@media(max-width:720px){ .dashboard-main-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:440px){ .dashboard-main-grid { grid-template-columns:1fr; } }
.vaccination-recipient { display:flex!important; flex-direction:row!important; align-items:center; gap:10px; padding:8px; }
.vaccination-recipient input { width:18px!important; height:18px!important; }
.customer-card-list { display:grid; gap:12px; }
.customer-list-card { width:100%; display:flex; align-items:center; justify-content:space-between; gap:20px; text-align:left; padding:20px; border:1px solid #d1e3e1; border-radius:18px; background:rgba(255,255,255,.65); color:inherit; cursor:pointer; font:inherit; }
.customer-list-card small { display:block; color:#698895; margin-top:6px; }
.customer-list-card:hover,.customer-list-card:focus-visible { background:#e9f7f4; border-color:#21958c; }
.customer-order-items { width:100%; flex-basis:100%; color:#466773; }
.customer-order-items p { margin:6px 0; }
.customer-orders .order-row { display:flex; flex-wrap:wrap; padding:18px; margin:12px 0; border:1px solid #d1e3e1; border-radius:16px; }
.customer-orders .order-open { width:100%; }
#customer-detail[hidden],#customer-editor[hidden] { display:none!important; }
.client-profile-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }
.client-profile-heading h2 { margin:4px 0 8px; font-size:22px; }
.client-profile-heading p { margin:6px 0; font-size:13px; color:#66808c; }
.client-profile-heading .eyebrow { font-size:10px; }
.client-order-counts { font-size:12px!important; }
.topline { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.reminder-bell { position:relative; }
.reminder-bell summary { display:flex; align-items:center; gap:6px; cursor:pointer; padding:8px 12px; border:1px solid #d3e4e1; border-radius:12px; background:#f6fcfa; color:#237e77; list-style:none; }
.reminder-bell summary svg { width:20px; height:20px; }
.reminder-panel { position:absolute; right:0; top:44px; z-index:50; width:min(370px,85vw); max-height:65vh; overflow:auto; background:#f9fcfb; padding:16px; border:1px solid #d3e4e1; border-radius:14px; box-shadow:0 8px 24px #214a4a22; }
.reminder-panel h3 { margin:0 0 12px; }
.order-reminder { display:flex; flex-direction:column; gap:5px; width:100%; padding:12px; margin:6px 0; text-align:left; cursor:pointer; color:#285b60; border:1px solid #dce9e6; border-radius:10px; background:white; font:inherit; font-size:13px; }
.order-reminder small { color:#738e94; }
.order-reminder.overdue { border-left:3px solid #c37557; }
.order-reminder.today { border-left:3px solid #249389; }
.order-reminder:hover { background:#eef8f5; }
.delivery-overview { margin-bottom:20px; }
.delivery-overview [data-reminder-list] { max-height:300px; overflow:auto; }
.delivery-overview h2 { font-size:18px; margin:0 0 12px; }
.sales-drawer .order-main-grid,.sales-drawer .sales-line-grid { align-items:end; }
.sales-drawer .order-main-grid > label,.sales-drawer .sales-line-grid > label { display:flex; flex-direction:column; justify-content:flex-end; gap:6px; }
.sales-drawer .order-optional { display:none; }
.sales-drawer .order-main-grid > input[type=hidden],.sales-drawer .sales-line-grid > input[type=hidden] { display:none!important; }
.client-heading-actions { display:flex; align-items:center; gap:8px; }
.client-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 24px; }
.client-kpi { padding:14px 16px; min-height:116px; box-sizing:border-box; border:1px solid #e0e9e9; border-radius:12px; background:rgba(255,255,255,.8); box-shadow:0 2px 5px rgba(20,60,65,.025); display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.client-kpi-icon { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; background:#edf2f4; color:#6a808b; }
.client-kpi-icon svg { width:17px; height:17px; }
.client-kpi-icon.blue { background:#e8effb; color:#577bc2; }
.client-kpi-icon.green { background:#e2f4ee; color:#278f7f; }
.client-kpi-icon.purple { background:#f0eafa; color:#9473ba; }
.client-kpi-icon.orange { background:#fff0e2; color:#bb793d; }
.client-kpi-label { font-size:12px; color:#6a7d86; }
.client-kpi strong { font-size:22px; line-height:1.25; font-weight:600; overflow-wrap:anywhere; }
.client-kpi small { font-size:10px; color:#85969d; }
.client-kpi .client-debt-value { color:#b66b35; }
.client-orders-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.client-orders-heading h3 { margin:0; font-size:16px; }
.client-menu { position:relative; }
.client-menu summary { list-style:none; cursor:pointer; font-size:24px; padding:0 10px; border-radius:8px; }
.client-menu summary::-webkit-details-marker { display:none; }
.client-menu > div { position:absolute; right:0; top:36px; width:180px; z-index:10; padding:6px; border:1px solid #dce7e7; border-radius:10px; background:#fff; box-shadow:0 6px 20px #204d4d15; }
.client-menu button { display:block; width:100%; border:0; background:transparent; padding:10px; text-align:left; cursor:pointer; color:inherit; }
.client-menu button:hover { background:#edf7f5; }
@media(max-width:760px){.client-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}.client-kpi strong{font-size:20px;}}
.feed-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.feed-metrics .panel { padding:20px; }
.finance-redesign .metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media(max-width:650px){.finance-redesign .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
.feed-metrics small { color:#62828b; text-transform:uppercase; }
@media(max-width:900px){.feed-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}}
.vaccination-compact .entity-form { gap:14px; }
.vaccination-compact .form-grid { gap:12px; }
.vaccine-picker { border:1px solid #cfe1df; border-radius:14px; padding:12px; background:rgba(255,255,255,.5); }
.vaccine-picker summary { cursor:pointer; font-weight:600; color:#24545b; overflow-wrap:anywhere; }
.vaccine-picker[open] > summary { margin-bottom:12px; }
.vaccine-options { max-height:240px; overflow-y:auto; margin-top:8px; }
.vaccination-compact .vaccination-recipient { margin:0; padding:7px!important; min-height:40px; }
.vaccination-recipient small { display:block; font-weight:400; color:#64848a; }
.vaccination-compact [hidden] { display:none!important; }
.vaccine-object { display:block; width:100%; text-align:left; padding:10px; border:0; border-radius:8px; color:inherit; background:transparent; cursor:pointer; }
.vaccine-object:hover,.vaccine-object:focus-visible { background:#e4f4f1; }
.vaccination-compact [data-coverage] { font-size:12px; margin:0; }
.vaccination-highlight { outline: 2px solid #168d84; outline-offset: 3px; }
.farm-direction-title { min-width:0; flex:1; }
.farm-direction-title small { display:block; margin-top:4px; font-size:11px; font-weight:400; opacity:.8; }
.poultry-breed-picker{position:relative;width:100%}
.poultry-breed-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0;pointer-events:none}
.poultry-breed-toggle{width:100%;text-align:left;padding:12px 16px;border:1px solid #c8dedd;border-radius:14px;background:#fff;color:#173d43;cursor:pointer;font:inherit}
.poultry-breed-toggle:after{content:'⌄';float:right}
.poultry-breed-menu{position:relative;margin-top:4px;max-height:240px;overflow:auto;background:#fff;border:1px solid #c8dedd;border-radius:12px;padding:4px;box-shadow:0 8px 20px #1233}
.poultry-breed-menu[hidden]{display:none}
.poultry-breed-option{display:flex;align-items:center}.poultry-breed-option button{border:0;background:transparent;text-align:left;padding:10px;cursor:pointer;color:#173d43;font:inherit}.poultry-breed-option button:first-child{flex:1}.poultry-breed-option:hover{background:#e8f5f1}.poultry-breed-option .poultry-breed-remove{color:#b13748;font-size:22px;min-width:40px}
.assignment-fields{border:1px solid #cbdedd;border-radius:14px;padding:16px;min-width:0;grid-column:1/-1;width:100%;box-sizing:border-box}
.assignment-row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:12px 0}
.assignment-row label{display:flex;align-items:center;gap:8px}.assignment-row input[type=checkbox]{width:18px;height:18px;flex:none}.assignment-row select{max-width:230px}
@media(max-width:520px){.assignment-row{align-items:stretch;flex-direction:column;gap:6px}.assignment-row select{max-width:none}}
/* Analytics: compact dashboard, scoped to this page only. */
.reports-dashboard{display:grid;gap:18px;min-width:0}
.reports-dashboard .reports-header{display:grid;grid-template-columns:1fr;gap:18px}
.reports-dashboard .reports-header h1{font-size:clamp(28px,3vw,42px);line-height:1.15}
.reports-dashboard .reports-header .workspace-heading{margin:0}
.reports-dashboard .panel{padding:22px;border-radius:24px;background:rgba(255,255,255,.92);box-shadow:none;margin:0;min-width:0}
.reports-dashboard .panel.report-period{display:block;padding:22px}
.reports-dashboard .period-fields{display:grid;grid-template-columns:1fr 1fr auto;align-items:end;gap:16px}
.reports-dashboard .period-fields>strong{display:none}
.reports-dashboard .period-fields label{display:grid;gap:8px;min-width:0}
.reports-dashboard .period-fields input{min-width:0;width:100%;height:44px;border-radius:12px;background:#fff}
.reports-dashboard .period-fields .button{height:44px;padding:0 24px}
.reports-dashboard .report-presets{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.reports-dashboard .report-presets button{font:inherit;font-size:13px;padding:8px 16px;border:0;border-radius:20px;color:#315661;background:#edf5f3;cursor:pointer}
.reports-dashboard .report-presets button[aria-pressed=true]{color:#087c76;background:#e2f5f0;border-color:#bce6dd}
.reports-dashboard button:focus-visible,.reports-dashboard summary:focus-visible{outline:2px solid #148780;outline-offset:3px}
.reports-dashboard #report-content{display:grid;gap:18px;min-width:0;text-align:left}
.reports-dashboard .report-section-title{font-size:21px;margin:0;font-weight:700}
.reports-dashboard .report-finance .metric-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.reports-dashboard .report-operations .metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.reports-dashboard .metric-grid{gap:18px;margin:0;padding:0}
.reports-dashboard .metric-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:24px;min-height:138px;border-radius:24px;background:rgba(255,255,255,.92);box-shadow:none}
.reports-dashboard .metric-card>span{font-size:14px;font-weight:600;letter-spacing:0;text-transform:none;padding-right:38px;color:#254c57}
.reports-dashboard .metric-card>strong{font-size:clamp(21px,2vw,32px);line-height:1.2;overflow-wrap:anywhere;letter-spacing:-.5px}
.reports-dashboard .metric-card>small{font-size:12px;line-height:1.5;color:#63818b}
.reports-dashboard .metric-card .metric-icon{position:absolute;right:18px;top:16px;width:34px;height:34px;margin:0;border-radius:12px;background:#e0f4ef;box-shadow:none;color:#148780}
.reports-dashboard .metric-warning>strong{color:#ab4828}
.reports-dashboard .report-debt{display:flex;align-items:center;gap:24px;padding:18px 22px}
.reports-dashboard .panel h2{font-size:19px;margin:0 0 8px}
.reports-dashboard .report-debt strong{font-size:25px;margin-left:auto}
.reports-dashboard .report-debt small{color:#63818b}
.reports-dashboard .report-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#e0f4ef;color:#148780}
.reports-dashboard .report-sales{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0}
.reports-dashboard .report-sales .compact-empty{min-height:100px;padding:24px 12px;font-size:14px}
.reports-dashboard .report-mortality{padding:16px 22px;font-size:13px;color:#63818b}
.reports-dashboard .report-mortality summary{font-weight:600;color:#315661;cursor:pointer}
@media(max-width:1200px){.reports-dashboard .reports-header{grid-template-columns:1fr}.reports-dashboard .report-finance .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.reports-dashboard .report-finance .metric-grid,.reports-dashboard .report-operations .metric-grid,.reports-dashboard .report-sales{grid-template-columns:1fr}.reports-dashboard .period-fields{display:grid;grid-template-columns:1fr 1fr}.reports-dashboard .period-fields>strong,.reports-dashboard .period-fields>.button{grid-column:1/-1}.reports-dashboard .period-fields label{display:grid;min-width:0}.reports-dashboard .report-presets{gap:6px}.reports-dashboard .report-presets button{flex:1;white-space:nowrap;padding:8px}.reports-dashboard .report-debt{gap:12px}.reports-dashboard .report-icon{display:none}.reports-dashboard .metric-card{min-height:120px}.reports-dashboard .metric-card>strong{font-size:28px}}
/* Expense history retains records; monthly tabs only select a date range. */
.expenses-dashboard{display:grid;gap:18px;min-width:0}
.expenses-dashboard .workspace-heading{display:flex;align-items:center;gap:12px;margin:0}.expenses-dashboard .workspace-heading>div{margin-right:auto}
.expenses-dashboard .panel{background:rgba(255,255,255,.92);border-radius:24px;padding:22px;margin:0;box-shadow:none;min-width:0}
.expenses-dashboard .finance-controls{display:block}
.expenses-dashboard .period-fields{display:grid;grid-template-columns:1.15fr 1fr 1fr auto;align-items:end;gap:16px;width:100%}
.expenses-dashboard .period-fields label{display:grid;gap:8px;min-width:0}.expenses-dashboard .period-fields input,.expenses-dashboard .period-fields select{width:100%;min-width:0;height:44px}
.expenses-dashboard .expense-tabs{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.expenses-dashboard .expense-tabs span{font-size:12px;color:#63818b}.expenses-dashboard .expense-tabs [aria-pressed=true]{background:#dcf3ed;color:#087d75;border-color:#b7e0d8}
.expenses-dashboard .expense-presets{display:flex;gap:8px;margin-top:12px}.expenses-dashboard .expense-presets button{border:0;background:#edf5f3;color:#315661;border-radius:20px;padding:8px 16px;cursor:pointer;font:inherit;font-size:13px}
.expenses-dashboard [hidden]{display:none!important}.expenses-dashboard .expense-month{display:grid;gap:6px;max-width:230px;margin-bottom:16px}
.expenses-dashboard #finance-summary{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:0;text-align:left;min-height:0}.expenses-dashboard #finance-summary .panel{display:flex;flex-direction:column;gap:8px;padding:24px}.expenses-dashboard #finance-summary h2,.expenses-dashboard #finance-summary strong{font-size:30px;margin:0;line-height:1.2}.expenses-dashboard #finance-summary h3,.expenses-dashboard #finance-summary small{font-size:14px;font-weight:500;margin:0;color:#577782}.expenses-dashboard #finance-summary p{font-size:12px;color:#63818b;margin:0}
.expenses-dashboard #finance-results{padding:0}.expenses-dashboard h2{font-size:19px;margin:0 0 8px}.expenses-dashboard .expense-range,.expenses-dashboard .expense-feed-details>p{font-size:12px;color:#63818b;margin:0 0 16px}
.expenses-dashboard .expense-table-wrap{overflow-x:auto}.expenses-dashboard .expense-table{width:100%;border-collapse:collapse;font-size:14px}.expenses-dashboard .expense-table th{text-align:left;background:#eff7f5;color:#63818b;font-size:12px;font-weight:500}.expenses-dashboard .expense-table td,.expenses-dashboard .expense-table th{padding:14px 12px;border-bottom:1px solid #e1ecec}.expenses-dashboard .expense-table td:nth-child(4){text-align:right;white-space:nowrap}.expenses-dashboard .expense-table small{display:block;margin-top:4px;color:#63818b}.expenses-dashboard .expense-category{display:inline-block;background:#e3f5ef;padding:5px 10px;border-radius:10px;color:#137d75}.expenses-dashboard .expense-table .button{padding:7px 12px;font-size:12px}.expenses-dashboard .expense-feed-details{overflow-x:auto}
@media(max-width:700px){.expenses-dashboard .workspace-heading{flex-wrap:wrap}.expenses-dashboard .workspace-heading>div{width:100%}.expenses-dashboard .period-fields{grid-template-columns:1fr 1fr}.expenses-dashboard .period-fields>label:first-child,.expenses-dashboard .period-fields>.button{grid-column:1/-1}.expenses-dashboard #finance-summary{grid-template-columns:1fr}.expenses-dashboard .panel{padding:16px}.expenses-dashboard .expense-table{min-width:560px}}
.feeding-dashboard{display:grid;gap:18px;min-width:0}.feeding-dashboard .workspace-heading{margin:0}.feeding-dashboard .panel{background:rgba(255,255,255,.92);padding:22px;border-radius:24px;box-shadow:none;margin:0;min-width:0}.feeding-dashboard .feeding-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.feeding-dashboard .feeding-kpis article{display:flex;flex-direction:column;gap:8px}.feeding-dashboard .feeding-kpis small{font-size:14px;color:#63818b}.feeding-dashboard .feeding-kpis strong{font-size:28px;line-height:1.2}.feeding-dashboard .feeding-kpis span,.feeding-dashboard .feeding-cost-note,.feeding-dashboard .feeding-hint{font-size:12px;color:#63818b}.feeding-dashboard .feeding-cost-note{margin:-6px 0 0}.feeding-dashboard .feeding-tabs,.feeding-dashboard .feeding-presets{display:flex;gap:10px;flex-wrap:wrap}.feeding-dashboard .feeding-tabs [aria-pressed=true]{background:#def3ed;color:#087b75;border-color:#c2e7df}.feeding-dashboard [data-journal]{display:grid;gap:18px}.feeding-dashboard [hidden]{display:none!important}.feeding-dashboard .period-fields{display:grid;grid-template-columns:1fr 1fr auto;gap:16px;align-items:end}.feeding-dashboard .period-fields label{display:grid;gap:8px;min-width:0}.feeding-dashboard .period-fields input{width:100%;min-width:0;height:44px}.feeding-dashboard .feeding-presets{margin-top:12px}.feeding-dashboard .feeding-presets button{font:inherit;font-size:13px;background:#eef6f3;border:0;border-radius:20px;padding:8px 16px;cursor:pointer;color:#315661}.feeding-dashboard h2{font-size:20px;margin:0 0 18px}.feeding-dashboard .feeding-table-wrap{overflow:auto}.feeding-dashboard .feeding-table{border-collapse:collapse;width:100%;font-size:14px}.feeding-dashboard .feeding-table th{text-align:left;font-size:12px;color:#63818b;font-weight:500}.feeding-dashboard .feeding-table td,.feeding-dashboard .feeding-table th{padding:16px 12px;border-bottom:1px solid #dfebea}.feeding-dashboard .feeding-table td:nth-child(3),.feeding-dashboard .feeding-table td:nth-child(4){white-space:nowrap}.feeding-dashboard .feeding-table small{display:block;color:#63818b;margin-top:5px}.feeding-dashboard .feeding-table tbody tr{cursor:pointer}.feeding-dashboard .feeding-table tbody tr:hover{background:#eff8f5}.feeding-open{border:0;border-radius:50%;background:#edf7f4;color:#168780;font-size:24px;width:32px;height:32px;cursor:pointer}
dialog.feeding-modal{position:fixed;inset:0;margin:auto;width:min(480px,calc(100vw - 24px));max-height:90dvh;height:auto;padding:26px;border:1px solid #e0ece9;border-radius:24px;background:#fff;color:#204650;overflow:auto;box-shadow:0 20px 70px #163f4929}dialog.feeding-modal::backdrop{background:#193f4955;backdrop-filter:blur(3px)}.feeding-modal>.editor-close{position:absolute;right:16px;top:16px}.feeding-modal h2{font-size:22px;margin:0 32px 22px 0}.feeding-modal .feeding-entry-grid{display:grid;grid-template-columns:1fr;gap:14px}.feeding-modal .feeding-entry{padding:0;border:0;background:none}.feeding-modal .feeding-allocations{display:grid;grid-template-columns:1fr;gap:10px}.feeding-modal .feeding-allocations label{display:grid;gap:6px}.feeding-modal .entity-form{display:grid;gap:14px}.feeding-modal .editor-actions{display:flex;gap:12px}.feeding-modal .editor-actions .button{flex:1}.feeding-modal .muted-text,.feeding-modal [data-balance]{font-size:12px;color:#63818b;margin:0}.feeding-modal [data-saved]:empty{display:none}.feeding-modal .feeding-picker-panel{position:relative;width:100%;max-height:250px;overflow:auto}.feeding-modal [hidden]{display:none!important}
@media(max-width:900px){.feeding-dashboard .feeding-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.feeding-dashboard .feeding-kpis{gap:10px}.feeding-dashboard .feeding-kpis .panel{padding:16px}.feeding-dashboard .feeding-kpis strong{font-size:23px}.feeding-dashboard .period-fields{grid-template-columns:1fr 1fr}.feeding-dashboard .period-fields>.button{grid-column:1/-1}.feeding-dashboard .feeding-table{min-width:580px}.feeding-dashboard .panel{padding:16px}}
