:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --panel: #ffffff;
  --panel-2: #eef5ef;
  --ink: #17231c;
  --muted: #647067;
  --line: #dce6de;
  --green: #2f7d4c;
  --green-2: #78a85c;
  --teal: #237b78;
  --blue: #2f638f;
  --amber: #c27b28;
  --red: #ba3b32;
  --shadow: 0 18px 44px rgba(29, 54, 40, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  background: #173123;
  color: #eff7ee;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 12px;
}

.brand-mark,
.avatar,
.vet-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
}

.brand-mark {
  width: 44px;
  height: 44px;
  background: #cce7cf;
  color: #173123;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1;
}

.brand p,
.profile-card p,
.nav-group-title {
  margin: 4px 0 0;
  color: rgba(239, 247, 238, 0.72);
  font-size: 12px;
}

.role-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.workspace-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.workspace-tab {
  border: 0;
  min-height: 36px;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: #dbe8dc;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.workspace-tab.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.app-shell.workspace-accounting .workspace-tab.active {
  background: rgba(96, 165, 250, 0.28);
}

.role-switch button,
.nav-item,
.icon-button,
.primary,
.secondary,
.ghost,
.chip,
.mini-tab {
  border: 0;
  border-radius: var(--radius);
}

.role-switch button {
  min-height: 34px;
  color: #dbe8dc;
  background: transparent;
}

.role-switch button.active {
  color: #173123;
  background: #d7edd7;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.nav-group-title {
  padding: 12px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  color: #eef8ee;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
}

.nav-item.active {
  box-shadow: inset 3px 0 #bde2be;
}

.badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
}

.profile-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  background: #e8f1e9;
  color: #173123;
  font-weight: 800;
}

.main {
  min-width: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 11;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(244, 247, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.mobile-menu {
  display: none;
}

.icon-button.mobile-menu {
  display: none;
}

.topbar h2 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search {
  position: relative;
  width: min(430px, 42vw);
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 12px;
  min-height: 42px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.language-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.language-switch button.active {
  color: #fff;
  background: var(--green);
}

.search input {
  border: 0;
  outline: 0;
  min-width: 0;
  background: transparent;
}

.tag-search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  gap: 2px;
  max-height: min(360px, 55vh);
  padding: 6px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tag-search-suggestion {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
}

.tag-search-suggestion:hover,
.tag-search-suggestion:focus-visible {
  background: var(--panel-2);
  outline: none;
}

.tag-search-suggestion strong {
  color: var(--green);
  font-size: 14px;
}

.tag-search-suggestion span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  padding: 24px 28px 44px;
  min-width: 0;
  overflow-x: hidden;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(12, 29, 20, 0.84), rgba(12, 29, 20, 0.34)),
    url("./assets/hero-farm.jpg")
      center/cover;
}

.hero-copy h3 {
  max-width: 740px;
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
}

.hero-actions,
.inline-actions,
.passport-actions,
.filter-row,
.card-actions,
.status-row,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin-top: 22px;
}

.primary,
.secondary,
.ghost,
.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.primary {
  color: #fff;
  background: var(--green);
}

.secondary {
  color: var(--ink);
  background: #e6efe7;
  border: 1px solid var(--line);
}

.ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.icon-button {
  width: 40px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.panel,
.animal-card,
.clinic-card,
.timeline-item,
.message,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(23, 35, 28, 0.02);
}

.panel {
  padding: 18px;
}

.panel.shadow {
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
  min-width: 0;
}

.panel-title h3,
.panel-title h4,
.animal-card h3,
.clinic-card h3,
.visit-card h3 {
  margin: 0;
}

.panel-title p,
.metric span,
.animal-card p,
.clinic-card p,
.visit-card p,
.timeline-item p,
.passport-list span,
.small,
.muted {
  color: var(--muted);
}

.metric {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#riskMetricCard {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#riskMetricCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 54, 40, 0.15);
  border-color: var(--green-2);
}

.metric strong {
  font-size: 34px;
}

.metric .trend {
  color: var(--green);
  font-weight: 700;
}

.animal-card {
  overflow: hidden;
}

.animal-photo {
  height: 162px;
  width: 100%;
  object-fit: cover;
  display: block;
}

.animal-body {
  padding: 14px;
}

.animal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.animal-class-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.animal-class-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3ef;
  color: #405047;
  font-size: 11px;
  font-weight: 800;
}

.livestock-class-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.livestock-class-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
}

.livestock-class-head h4 {
  margin: 0;
  font-size: 16px;
}

.livestock-class-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.animal-category-shell {
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
}

.animal-category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.animal-category-heading h4 {
  margin: 0;
  font-size: 16px;
}

.animal-category-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.animal-category-grid {
  display: grid;
  gap: 10px;
}

.animal-category-grid.species-row {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.animal-category-grid.cattle-row {
  grid-template-columns: repeat(6, minmax(112px, 1fr));
}

.herd-summary-panel--hero {
  margin: 0;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.herd-summary-panel--hero .herd-summary-grid {
  flex: 1;
  align-items: stretch;
}

.herd-summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(100px, 1fr));
  gap: 12px;
}

.herd-summary-total,
.herd-summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.herd-summary-total strong,
.herd-summary-card strong {
  font-size: 28px;
  line-height: 1;
  color: var(--green);
}

.herd-summary-total span,
.herd-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.herd-summary-total small {
  font-size: 11px;
  font-weight: 600;
}

.herd-summary-emoji {
  font-size: 22px;
  line-height: 1;
}

.animal-category-subheading {
  margin-top: 4px;
}

.animal-category-subheading h5 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.animal-category-emoji {
  font-size: 20px;
  line-height: 1;
}

.animal-category-card {
  min-height: 96px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.animal-category-card:hover,
.animal-category-card.active {
  border-color: #9fc9ab;
  background: #eef8f0;
  box-shadow: 0 0 0 2px rgba(47, 125, 76, 0.12);
}

.animal-category-card.active {
  border-left: 4px solid var(--green);
}

.animal-category-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.animal-category-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.animal-category-count {
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.mini-stat {
  padding: 9px;
  background: var(--panel-2);
  border-radius: var(--radius);
}

.mini-stat span,
.passport-list span {
  display: block;
  font-size: 12px;
}

.mini-stat strong,
.passport-list strong {
  display: block;
  margin-top: 2px;
}

.chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: #eef3ef;
  color: #405047;
  font-size: 13px;
}

.chip.green {
  color: #1d6a39;
  background: #dff2e4;
}

.chip.amber {
  color: #8d5417;
  background: #f7ead7;
}

.chip.red {
  color: #95322b;
  background: #f7dedc;
}

.passport-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.passport-cover {
  overflow: hidden;
}

.passport-cover img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.qr {
  width: 124px;
  height: 124px;
  margin-top: 14px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, #122217 12px, transparent 12px) 0 0/28px 28px,
    linear-gradient(#122217 12px, transparent 12px) 0 0/28px 28px,
    linear-gradient(90deg, transparent 8px, #122217 8px 16px, transparent 16px)
      7px 7px/24px 24px,
    #f8fbf8;
  border: 10px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.passport-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.passport-list div {
  padding: 12px;
  background: #f8fbf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 14px;
  padding: 14px;
  align-items: start;
}

.risk-dot,
.map-pin,
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--green);
}

.risk-warning,
.status-warning {
  background: var(--amber);
}

.status-amber {
  background: var(--amber);
}

.risk-danger,
.status-danger {
  background: var(--red);
}

.status-red {
  background: var(--red);
}

.status-green {
  background: var(--green);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 18px;
  width: 100%;
  min-width: 0;
  align-items: start;
}

.chat-window {
  min-width: 0;
  min-height: 420px;
  max-height: min(72vh, 620px);
  height: clamp(420px, 62vh, 620px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  flex-shrink: 0;
}

.chat-header-copy {
  min-width: 0;
  flex: 1 1 220px;
}

.chat-header-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-aside {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-height: min(72vh, 620px);
  overflow: auto;
}

.chat-side-panel {
  min-width: 0;
}

.chat-side-records .timeline-item {
  grid-template-columns: 1fr;
  gap: 6px;
}

.chat-side-records .timeline-item p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-patient-selector {
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
}

.message {
  max-width: min(82%, 100%);
  padding: 12px;
  box-shadow: none;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message.user {
  align-self: flex-end;
  background: #e4efe8;
}

.message.ai {
  align-self: flex-start;
}

.message.ai .apply-chart-btn {
  margin-top: 10px;
  width: fit-content;
}

.message-text {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-text pre,
.message-text code {
  white-space: pre-wrap;
  overflow-x: auto;
  max-width: 100%;
}

.message-text h3,
.message-text h4,
.message-text p,
.message-text ul {
  margin: 0;
}

.message-text h3 {
  font-size: 17px;
  line-height: 1.25;
}

.message-text h4 {
  margin-top: 4px;
  color: #28362f;
  font-size: 14px;
  line-height: 1.25;
}

.message-text ul {
  padding-left: 18px;
}

.message-text li {
  margin: 3px 0;
}

.message.pending {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.typing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 16px 0 0 rgba(47, 125, 76, 0.45), 32px 0 0 rgba(47, 125, 76, 0.2);
  animation: pulseTyping 0.9s infinite ease-in-out;
}

@keyframes pulseTyping {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

button:disabled,
input:disabled {
  cursor: progress;
  opacity: 0.7;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  min-width: 0;
}

.mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.mic-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.mic-btn.listening {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  animation: mic-pulse 1.5s infinite;
  box-shadow: 0 0 0 0px rgba(186, 59, 50, 0.4);
}

@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0px rgba(186, 59, 50, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(186, 59, 50, 0);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(186, 59, 50, 0);
  }
}



.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.vet-icd-panel {
  min-width: 0;
  max-height: 720px;
  display: flex;
  flex-direction: column;
}

.vet-icd-search {
  width: 100%;
  margin-bottom: 10px;
}

.vet-icd-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  max-height: 520px;
}

.vet-icd-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
}

.vet-icd-item:hover {
  border-color: #b9d4c0;
  background: #f4faf5;
}

.vet-icd-item strong {
  color: var(--green);
  font-size: 13px;
}

.vet-icd-item span {
  font-size: 14px;
}

.vet-icd-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mkv-chip {
  display: inline-block;
  margin: 4px 0;
}

.chat-form input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 96px;
  padding-top: 10px;
  resize: vertical;
}

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

.field label {
  display: block;
  margin-bottom: 6px;
  color: #405047;
  font-weight: 700;
  font-size: 13px;
}

.field.full {
  grid-column: 1 / -1;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.map-panel {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background:
    linear-gradient(30deg, transparent 48%, rgba(47, 125, 76, 0.12) 49%, transparent 51%)
      0 0/90px 90px,
    linear-gradient(120deg, transparent 48%, rgba(47, 99, 143, 0.13) 49%, transparent 51%)
      0 0/120px 120px,
    #e9efe8;
}

.map-road {
  position: absolute;
  height: 18px;
  width: 120%;
  left: -10%;
  top: 46%;
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(-12deg);
  box-shadow: 0 0 0 1px rgba(23, 35, 28, 0.08);
}

.map-road:nth-child(2) {
  top: 32%;
  transform: rotate(28deg);
}

.map-road:nth-child(3) {
  top: 68%;
  transform: rotate(8deg);
}

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 168px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pin::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.pin strong,
.pin span {
  display: block;
}

.pin span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.clinic-list {
  display: grid;
  gap: 12px;
}

.clinic-card {
  padding: 14px;
  box-shadow: none;
}

.clinic-head {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
}

.vet-avatar {
  width: 54px;
  height: 54px;
  background: #ddebe0;
}

.vet-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visit-card {
  padding: 14px;
  border-left: 4px solid var(--amber);
}

.visit-card.accepted {
  border-left-color: var(--green);
}

.visit-card.completed {
  border-left-color: var(--blue);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #405047;
  background: #f7faf7;
  font-size: 13px;
}

.mini-tab {
  min-height: 34px;
  padding: 0 12px;
  background: #eef3ef;
}

.mini-tab.active {
  color: #fff;
  background: var(--green);
}

.productivity-report-panel {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.productivity-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.productivity-metric {
  min-height: 86px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.productivity-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.productivity-metric strong {
  font-size: 22px;
  line-height: 1.1;
}

.productivity-insight-row {
  margin-top: 14px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line);
}

.productivity-insight-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.productivity-chip-list {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.productivity-chip,
.productivity-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.productivity-chip {
  min-height: 28px;
  padding: 0 10px;
  background: #eef3ef;
  color: var(--ink);
}

.productivity-chip.good {
  background: #dff2e4;
  color: #1d6a39;
}

.productivity-chip.warn {
  background: #f7ead7;
  color: #8d5417;
}

.productivity-rank {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: #f7ead7;
  color: #8d5417;
}

.productivity-history-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.prod-history-head,
.prod-history-controls,
.prod-history-legend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prod-history-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.prod-history-custom-title {
  margin-bottom: 12px;
}

.prod-history-custom-title h4 {
  margin: 0;
  font-size: 16px;
}

.prod-history-custom-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.productivity-history-panel.has-custom-title .prod-history-head > div:first-child {
  display: none;
}

.productivity-history-panel.has-custom-title .prod-history-head {
  justify-content: flex-end;
}

.prod-history-head h4 {
  margin: 0;
  font-size: 16px;
}

.prod-history-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.prod-history-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prod-history-controls select {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

.prod-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.prod-history-summary .productivity-metric {
  min-height: 74px;
}

.prod-history-chart {
  height: 190px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  gap: 6px;
  align-items: end;
  padding: 16px 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f1f7f2 100%);
}

.prod-history-day {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  height: 100%;
  text-align: center;
}

.prod-history-bars {
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
}

.prod-history-bars span {
  width: 7px;
  min-height: 0;
  border-radius: 6px 6px 0 0;
}

.prod-history-bars .milk,
.prod-history-legend .milk {
  background: var(--green);
}

.prod-history-bars .feed,
.prod-history-legend .feed {
  background: var(--blue);
}

.prod-history-day small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.prod-history-legend {
  justify-content: flex-end;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prod-history-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
}

.prod-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.prod-calendar-cell {
  min-height: 70px;
  padding: 8px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.prod-calendar-cell span,
.prod-calendar-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.prod-calendar-cell strong {
  color: var(--ink);
  font-size: 14px;
}

.prod-calendar-cell.level-1 { background: #eef7ef; }
.prod-calendar-cell.level-2 { background: #dff0e3; }
.prod-calendar-cell.level-3 { background: #cde7d4; }
.prod-calendar-cell.level-4 { background: #b8dcc4; }

.prod-history-table {
  margin-top: 14px;
}

.prod-history-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 14px;
  color: #fff;
  background: #173123;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.bottom-nav {
  display: none;
}

.error-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  color: #7a241f;
  background: #f8e3e0;
  border-color: #efc4bf;
}

@media (max-width: 1180px) {
  .hero,
  .map-layout,
  .chat-layout,
  .passport-layout,
  .exam-layout {
    grid-template-columns: 1fr;
  }

  .chat-aside {
    display: none;
  }

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

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 12;
    width: 286px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .icon-button.mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    height: auto !important;
    padding-bottom: 10px;
  }

  .search {
    display: grid !important;
    width: 100% !important;
    max-width: none !important;
    margin-top: 12px;
    order: 3;
  }

  .topbar-tools {
    margin-left: auto;
  }

  .content {
    padding: 16px;
  }

  .hero-copy {
    min-height: 360px;
    padding: 22px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .productivity-metric-grid,
  .prod-history-summary,
  .passport-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .animal-category-grid.cattle-row {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .herd-summary-grid {
    grid-template-columns: 1fr;
  }

  .animal-category-card {
    flex: 0 0 150px;
    scroll-snap-align: start;
  }

  .animal-category-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .productivity-insight-row {
    align-items: stretch;
    flex-direction: column;
  }

  .productivity-chip-list {
    justify-content: flex-start;
  }

  .prod-history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .prod-history-controls {
    justify-content: flex-start;
  }

  .prod-history-chart {
    overflow-x: auto;
    grid-template-columns: repeat(30, 22px);
  }

  .prod-calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .chat-window {
    height: min(68vh, 560px);
  }

  .message {
    max-width: 96%;
  }

  /* Bottom Navigation Bar for Mobile */
  .bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(23, 35, 28, 0.08);
    box-shadow: 0 -4px 20px rgba(23, 35, 28, 0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-side {
    flex: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
  }

  .bottom-nav-side.left {
    padding-right: 8px;
  }

  .bottom-nav-side.right {
    padding-left: 8px;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    gap: 4px;
    height: 100%;
    transition: color 0.2s ease, transform 0.1s ease;
    outline: none;
    cursor: pointer;
  }

  .bottom-nav-item:active {
    transform: scale(0.92);
  }

  .bottom-nav-item.active {
    color: var(--green);
  }

  .bottom-nav-item .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
  }

  .bottom-nav-item.active .icon {
    transform: translateY(-1px);
  }

  .bottom-nav-center {
    width: 72px;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
  }

  .bottom-nav-item-center {
    position: absolute;
    top: -20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    z-index: 1001;
    outline: none;
    cursor: pointer;
  }

  .fab-icon-wrap {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--green), #429f63);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(47, 125, 76, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .bottom-nav-item-center.active .fab-icon-wrap {
    background: linear-gradient(135deg, #1d5232, var(--green));
    box-shadow: 0 4px 18px rgba(47, 125, 76, 0.6);
  }

  .bottom-nav-item-center:active .fab-icon-wrap {
    transform: scale(0.9) translateY(2px);
  }

  .fab-icon-wrap .icon {
    width: 24px;
    height: 24px;
  }

  .fab-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: color 0.2s ease;
  }

  .bottom-nav-item-center.active .fab-label {
    color: var(--green);
  }

  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  /* Move toast higher to avoid overlap with bottom nav bar on mobile */
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  }

  .floating-action-bar {
    bottom: calc(118px + env(safe-area-inset-bottom)) !important;
    margin-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
    width: calc(100vw - 24px) !important;
    left: 12px !important;
    transform: none !important;
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 18px !important;
    white-space: normal !important;
  }

  .floating-action-bar > span {
    flex: 1 1 100%;
    text-align: center;
  }

  .floating-action-bar button {
    flex: 1 1 150px;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px !important;
    font-size: 12px;
  }

  .sidebar .nav {
    display: flex;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .topbar h2 {
    font-size: 18px;
  }

  .hero-copy h3 {
    font-size: 38px;
  }

  .map-panel {
    min-height: 480px;
  }

  .pin {
    min-width: 138px;
    font-size: 12px;
  }
}

.reset-db-btn {
  min-height: 42px;
  padding: 0 12px;
  background: #fdf2f2;
  color: #c53030;
  border: 1px solid #feb2b2;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-db-btn:hover {
  background: #fff5f5;
  border-color: #fc8181;
}

.reset-db-btn:active {
  background: #fed7d7;
}

/* Patient Card Layout Styles */
.patient-card-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.patient-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.patient-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.patient-avatar-wrapper {
  width: 50px;
  height: 50px;
  background: #cce7cf;
  color: #173123;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.patient-avatar-wrapper .icon {
  width: 26px;
  height: 26px;
}

.patient-name {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.patient-tag {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.patient-card-tabs-nav {
  padding: 8px;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.patient-tabs-list {
  display: flex;
  gap: 6px;
}

.patient-tabs-list .nav-item {
  width: auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
  border: 0;
  transition: all 0.2s ease;
}

.patient-tabs-list .nav-item .icon {
  width: 16px;
  height: 16px;
}

.patient-tabs-list .nav-item:hover,
.patient-tabs-list .nav-item.active {
  color: var(--green);
  background: var(--panel-2);
}

.patient-tabs-list .nav-item.active {
  box-shadow: none;
  border-bottom: 2px solid var(--green);
  border-radius: 6px 6px 0 0;
}

@media (max-width: 860px) {
  .vet-request-item {
    align-items: stretch;
    flex-direction: column;
  }

  .vet-request-actions {
    justify-content: stretch;
  }

  .vet-request-actions button {
    flex: 1 1 140px;
  }

  .patient-tabs-list {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .patient-tabs-list .nav-item {
    flex: 0 0 auto;
  }
}

/* Registration & Welcome Screen Styles */
.register-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% 0%, #dcefe4 0%, transparent 55%),
    linear-gradient(160deg, #eef6f0 0%, #f4f7f4 45%, #e8f2ec 100%);
}

.register-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: 22px;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: 0 18px 44px rgba(29, 54, 40, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-brand-mark {
  width: 52px;
  height: 52px;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
  border: 1px solid var(--line);
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand-copy {
  text-align: left;
}

.auth-brand-copy h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: var(--green);
  line-height: 1.1;
}

.auth-brand-copy p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: #eef5ef;
  border: 1px solid var(--line);
}

.auth-mode-tab {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.auth-mode-tab.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 6px 16px rgba(29, 54, 40, 0.08);
}

.auth-mode-tab-register:not(.active) {
  color: var(--teal);
  background: rgba(35, 123, 120, 0.08);
}

.auth-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-role-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.auth-section-title {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.auth-form-dual {
  max-height: min(70vh, 640px);
  overflow: auto;
  padding-right: 4px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.auth-field input:focus {
  outline: 2px solid rgba(47, 125, 76, 0.25);
  border-color: var(--green);
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-register-promo {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed #9fc4b0;
  background: linear-gradient(180deg, #f3faf5 0%, #e8f5ee 100%);
  text-align: left;
}

.auth-register-promo strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}

.auth-register-promo span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}

.auth-register-cta {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(35, 123, 120, 0.22);
}

.auth-register-cta:hover {
  filter: brightness(1.05);
}

.auth-server-toggle {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 6px 0 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  opacity: 0.85;
}

.auth-server-toggle:hover {
  color: var(--teal);
  text-decoration: underline;
}

.auth-footer-line {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #b9d9c1;
  border-radius: 14px;
  background: #eef8f0;
  color: #214d31;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.auth-switch {
  width: 100%;
  min-height: 42px;
  color: var(--green);
  background: transparent;
}

.vet-requests-panel {
  margin-bottom: 18px;
}

.vet-request-list {
  display: grid;
  gap: 10px;
}

.vet-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.vet-request-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.vet-request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.form-group input, .form-group select {
  transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--green);
}

/* Custom Chart Animations and Interactive Styles */
.chart-bar {
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
  position: relative;
  cursor: pointer;
}

.chart-bar::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-weight: 700;
  z-index: 100;
}

.chart-bar:hover {
  filter: brightness(1.05);
}

.chart-bar:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.small-tab-btn {
  transition: all 0.2s ease;
}

.small-tab-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.small-tab-btn.active {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quick-action-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12) !important;
}

.quick-action-btn:active {
  transform: translateY(1px);
}

.passport-details {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdfdfd;
  transition: border-color 0.2s;
  overflow: hidden;
}

.passport-details[open] {
  border-color: var(--primary);
}

.passport-details summary {
  padding: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  outline: none;
  list-style: none;
  background: rgba(16, 185, 129, 0.04);
  user-select: none;
}

.passport-details summary::-webkit-details-marker {
  display: none;
}

.passport-details summary:hover {
  background: rgba(16, 185, 129, 0.08);
}

.passport-details .details-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.passport-details[open] .details-icon {
  transform: rotate(90deg);
}

.animal-card.selected {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 2px rgba(47, 125, 76, 0.2), var(--shadow) !important;
}

/* Splash Screen Loader */
.splash-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #173123, #0c1d14);
  color: #fff;
  font-family: Inter, sans-serif;
  gap: 24px;
  text-align: center;
}

.splash-logo {
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
  padding: 12px;
  box-sizing: border-box;
  filter: drop-shadow(0 4px 20px rgba(47,125,76,0.3));
}

.splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.splash-screen h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-screen p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 6px 0 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scanner Modal Styles */
#scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: #000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#scanner-modal.active {
  display: flex;
}

#scanner-modal video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
}

.scanner-target-box {
  width: min(290px, 80vw);
  height: min(170px, 40vh);
  border: 3px solid var(--green, #2f7d4c);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 0 25px rgba(47, 125, 76, 0.5);
  background: transparent;
}

/* Corners for premium visual style */
.scanner-target-box::before, .scanner-target-box::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  pointer-events: none;
}

.scanner-target-box::before {
  top: -3px;
  left: -3px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 12px;
}

.scanner-target-box::after {
  bottom: -3px;
  right: -3px;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 12px;
}

.scanner-laser {
  position: absolute;
  top: 6px;
  left: 5%;
  width: 90%;
  height: 3px;
  background: var(--green, #2f7d4c);
  box-shadow: 0 0 12px var(--green, #2f7d4c), 0 0 4px #fff;
  animation: laser-scan 2.5s infinite ease-in-out;
  border-radius: 50%;
}

@keyframes laser-scan {
  0% { top: 6px; }
  50% { top: calc(100% - 9px); }
  100% { top: 6px; }
}

.scanner-controls {
  position: absolute;
  bottom: 50px;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 100000;
  pointer-events: auto;
}

.scanner-btn-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 14px 36px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scanner-btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.scanner-btn-close:active {
  transform: translateY(1px);
}

.scanner-status {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  z-index: 100000;
  pointer-events: none;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}

.scanner-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

.scanner-btn:hover {
  color: var(--green);
  transform: scale(1.15);
}

.scanner-btn svg {
  width: 20px;
  height: 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius);
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-right: 8px;
}

.back-btn:hover {
  background-color: rgba(47, 125, 76, 0.08);
  color: var(--green);
}

.back-btn:active {
  background-color: var(--panel-2);
  transform: scale(0.96);
}

.floating-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 2px solid var(--green);
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.selected-ai-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 0;
}

.selected-ai-context span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef8f0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.chat-send {
  width: 45px !important;
  height: 45px !important;
  min-width: 45px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-send:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(47, 125, 76, 0.35);
}

.chat-send:active:not(:disabled) {
  transform: scale(0.93);
}

/* Mobile stability layer */
img,
video,
canvas,
svg {
  max-width: 100%;
}

.panel,
.shadow,
.content,
.main,
.topbar,
.chat-layout,
.patient-card-container,
.patient-card-body,
.productivity-history-panel,
.productivity-report-panel,
.message,
.message-text,
.field,
.form-grid,
.table-wrap {
  min-width: 0;
}

.message-text,
.panel-title,
.productivity-metric,
.prod-calendar-cell,
.patient-name,
.patient-tag,
.vet-request-item,
.animal-card,
.timeline-item,
td,
th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

  .content {
    width: 100%;
    max-width: 100vw;
    padding: 12px;
  }

  .panel,
  .shadow,
  .productivity-report-panel,
  .productivity-history-panel {
    max-width: 100%;
    padding: 14px !important;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .panel-title > * {
    max-width: 100%;
  }

  .topbar {
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar h2,
  .topbar p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .topbar-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    margin-left: 0;
  }

  .lang-switch {
    flex: 1 1 180px;
    min-width: 0;
  }

  .search {
    min-width: 0;
  }

  .search input,
  .chat-form input,
  input,
  select,
  textarea {
    min-width: 0;
    max-width: 100%;
  }

  .chat-layout {
    gap: 12px;
    margin: -12px -12px -12px -12px !important;
  }

  .chat-window {
    height: calc(100vh - 170px) !important;
    height: calc(100dvh - 170px) !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: var(--bg) !important;
    min-height: 320px;
  }

  .messages {
    padding: 12px;
  }

  .message {
    max-width: 100%;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) 42px 48px;
    gap: 8px;
    padding: 10px;
  }

  .chat-form input {
    font-size: 14px;
  }

  .form-grid,
  #manualProductivityForm,
  form[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .field.full,
  #manualProductivityForm .field,
  #manualProductivityForm > div {
    grid-column: auto !important;
  }

  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .passport-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 4px;
    justify-content: stretch;
  }

  .passport-header {
    flex-direction: column;
    align-items: stretch;
  }

  .passport-actions button {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    justify-content: center;
    align-items: center;
  }

  .farm-report-actions .primary {
    width: 100%;
    min-width: 0;
  }

  .genetics-toolbar-actions {
    width: 100%;
  }

  .genetics-toolbar-actions select,
  .genetics-toolbar-actions .secondary,
  .genetics-form-actions .primary {
    width: 100%;
    min-width: 0;
  }

  .inline-actions button,
  .passport-actions button,
  .primary,
  .secondary {
    max-width: 100%;
  }

  .patient-card-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .patient-header-left {
    width: 100%;
    min-width: 0;
  }

  .patient-name {
    font-size: 18px;
  }

  .patient-card-tabs-nav {
    overflow: hidden;
  }

  .patient-tabs-list {
    scrollbar-width: thin;
  }

  .patient-tabs-list .nav-item {
    min-width: max-content;
    padding: 8px 12px;
  }

  .productivity-metric-grid,
  .prod-history-summary {
    grid-template-columns: 1fr !important;
  }

  .productivity-metric {
    min-height: 72px;
  }

  .prod-history-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .prod-history-controls .mini-tab {
    min-width: 0;
    padding: 0 6px;
  }

  .prod-history-controls select {
    grid-column: 1 / -1;
    width: 100%;
  }

  .prod-history-chart {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .prod-calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  .prod-calendar-cell {
    min-height: 64px;
    padding: 7px;
  }

  .prod-calendar-cell strong {
    font-size: 13px;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 560px;
  }

  .timeline-item {
    padding: 12px;
  }

  .floating-action-bar {
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 520px) {
  .content {
    padding: 10px;
  }

  .panel,
  .shadow,
  .productivity-report-panel,
  .productivity-history-panel {
    padding: 12px !important;
  }

  .topbar {
    padding: 10px;
  }

  .topbar h2 {
    font-size: 20px;
    line-height: 1.15;
  }

  .topbar p {
    font-size: 12px;
  }

  .lang-switch {
    flex: 1 1 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search {
    margin-top: 0;
  }

  .patient-avatar-wrapper {
    width: 42px;
    height: 42px;
  }

  .patient-name {
    font-size: 17px;
  }

  .chat-layout {
    margin: -10px -10px -10px -10px !important;
  }

  .chat-window {
    height: calc(100vh - 150px) !important;
    height: calc(100dvh - 150px) !important;
    min-height: 300px;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) 40px 46px;
  }

  .mic-btn,
  .chat-send {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
  }

  .bottom-nav-item {
    font-size: 9px;
  }

  .bottom-nav-item span {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bottom-nav-center {
    width: 62px;
  }

  .fab-icon-wrap {
    width: 48px;
    height: 48px;
  }

  .fab-label {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .prod-calendar-grid {
    grid-template-columns: 1fr !important;
  }

  table {
    min-width: 500px;
  }

  th,
  td {
    padding: 10px;
    font-size: 12px;
  }
}

.breeding-alert-panel {
  border-left: 4px solid #f59e0b;
  overflow: hidden;
}

.breeding-alert-count {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  min-width: 32px;
  padding: 0 10px;
}

.breeding-alert-empty {
  margin: 12px 0 0;
}

.breeding-alert-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.breeding-alert-item {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.breeding-alert-item:hover {
  border-color: #f59e0b;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.12);
}

.breeding-alert-main {
  min-width: 0;
}

.breeding-alert-main strong,
.breeding-alert-main > span {
  display: block;
  overflow-wrap: anywhere;
}

.breeding-alert-main > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.breeding-alert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.breeding-alert-meta span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.breeding-alert-meta b {
  color: var(--ink);
}

.breeding-record-details {
  background: #fbfbf8;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
}

.breeding-record-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.breeding-record-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.record-breeding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.record-breeding-meta span {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.record-breeding-meta b {
  color: #431407;
}

.breeding-due {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

.breeding-due.urgent {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

@media (max-width: 720px) {
  .breeding-alert-panel {
    padding: 12px !important;
  }

  .breeding-alert-item {
    grid-template-columns: 1fr;
  }

  .breeding-due {
    justify-self: flex-start;
    white-space: normal;
  }

  .breeding-alert-meta {
    flex-direction: column;
  }

  .breeding-alert-meta span {
    border-radius: 8px;
  }

  .breeding-record-grid {
    grid-template-columns: 1fr;
  }

  .record-breeding-meta {
    flex-direction: column;
  }

  .record-breeding-meta span {
    border-radius: 8px;
  }
}

.forecast-panel {
  margin-top: 18px;
  padding: 20px;
}

.forecast-panel-header {
  align-items: flex-start;
  gap: 16px;
}

.forecast-panel-header p {
  max-width: 720px;
}

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

.forecast-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
}

.forecast-card.attention {
  border-left-color: var(--amber);
  background: #fffbf2;
}

.forecast-card.danger {
  border-left-color: var(--red);
  background: #fff7f6;
}

.forecast-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.forecast-card-heading h4 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 16px;
}

.forecast-score {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.forecast-horizon,
.forecast-explanation,
.forecast-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.forecast-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.forecast-factors span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}

.forecast-actions {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.animal-forecast-preview {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fffbf2;
  color: #8a551d;
  font-size: 12px;
}

.animal-forecast-preview.danger {
  background: #fff1f0;
  color: var(--red);
}

@media (max-width: 720px) {
  .forecast-panel {
    padding: 14px;
  }

  .forecast-panel-header {
    flex-direction: column;
  }

  .forecast-grid {
    grid-template-columns: 1fr;
  }

  .animal-forecast-preview {
    flex-direction: column;
  }
}

.smart-calendar-page {
  display: grid;
  gap: 18px;
}

.smart-calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-filters select {
  min-width: 150px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

.calendar-layout > .panel {
  padding: 18px;
}

.calendar-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.smart-calendar-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.smart-calendar-day {
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  position: relative;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.smart-calendar-day.empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.smart-calendar-day.today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.smart-calendar-day.selected {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--blue);
}

.smart-calendar-day small {
  position: absolute;
  right: 6px;
  bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-day-panel .calendar-day-block {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.calendar-day-panel h4 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.calendar-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 8px 3px 0 0;
  border-radius: 50%;
  background: var(--blue);
}

.calendar-dot.vaccination,
.calendar-event.vaccination { --event-color: var(--teal); }
.calendar-dot.examination,
.calendar-event.examination { --event-color: var(--blue); }
.calendar-dot.analysis,
.calendar-event.analysis { --event-color: #7c3aed; }
.calendar-dot.pregnancy,
.calendar-event.pregnancy { --event-color: #be185d; }
.calendar-dot.treatment,
.calendar-event.treatment { --event-color: var(--amber); }
.calendar-dot.custom,
.calendar-event.custom { --event-color: var(--muted); }

.calendar-dot {
  background: var(--event-color, var(--blue));
}

.calendar-event-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow-y: auto;
}

.calendar-event {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--event-color, var(--blue));
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.calendar-event.overdue {
  background: #fff7f6;
  border-left-color: var(--red);
}

.calendar-event.completed {
  opacity: 0.66;
}

.calendar-event-date {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 12px;
}

.calendar-event-date span,
.calendar-category {
  color: var(--event-color, var(--muted));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-event-content h4,
.pregnancy-history-item h4 {
  margin: 3px 0;
}

.calendar-event-content p,
.pregnancy-history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.calendar-event-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.pregnancy-monitor {
  display: grid;
  gap: 18px;
}

.pregnancy-active-card {
  padding: 20px;
}

.pregnancy-progress {
  height: 12px;
  margin: 15px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.pregnancy-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #be185d);
}

.pregnancy-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pregnancy-metrics > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pregnancy-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.calving-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pregnancy-timeline {
  display: grid;
  gap: 10px;
}

.pregnancy-history-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-left: 3px solid #be185d;
  background: var(--panel-2);
  border-radius: var(--radius);
}

.pregnancy-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border-left: 4px solid #be185d;
}

.pregnancy-summary-card h3 {
  margin: 8px 0 4px;
}

.pregnancy-summary-card p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .smart-calendar-toolbar,
  .pregnancy-summary-card {
    flex-direction: column;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-event {
    grid-template-columns: 1fr;
  }

  .calendar-event-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .smart-calendar-day {
    min-height: 48px;
    padding: 5px;
  }

  .pregnancy-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .pregnancy-history-item {
    grid-template-columns: 1fr;
  }
}

.ledger-page { display: grid; gap: 18px; }
.ledger-page.soliq-hub { max-width: 920px; }
.ledger-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px; }
.ledger-kpi { gap: 12px; }
.ledger-kpi .panel { padding: 16px; display: grid; gap: 8px; }
.ledger-kpi span { color: var(--muted); font-size: 12px; font-weight: 700; }
.ledger-kpi strong { font-size: 22px; }
.profit-plus { color: var(--green); }
.profit-minus { color: var(--red); }
.ledger-table { display: grid; gap: 10px; max-height: 640px; overflow: auto; }
.ledger-row, .warehouse-item-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(29, 54, 40, 0.04);
}
.ledger-row.income { border-left: 4px solid var(--green); }
.ledger-row.expense { border-left: 4px solid var(--amber); }
.warehouse-item-card.low { border-left: 4px solid var(--amber); }
.warehouse-item-card.expired, .warehouse-item-card.expiring_soon { border-left: 4px solid var(--red); }
.ledger-row h4, .warehouse-item-card h4 { margin: 2px 0; }
.ledger-row p, .warehouse-item-card p { margin: 0; color: var(--muted); font-size: 12px; }
.stock-alerts-panel { padding: 16px; border-radius: 18px; }
.stock-alert-list { display: grid; gap: 8px; }
.stock-alert-item { display: grid; gap: 2px; padding: 10px; border-radius: 12px; background: var(--panel-2); }
.stock-alert-item.expired, .stock-alert-item.expiring_soon { border-left: 3px solid var(--red); }
.stock-alert-item.low { border-left: 3px solid var(--amber); }

.soliq-summary-static {
  cursor: default;
}
button.soliq-summary-static,
.soliq-summary-main.soliq-summary-static {
  pointer-events: none;
}
.soliq-date-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}
.soliq-date-filters input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.soliq-card {
  border-radius: 18px !important;
  padding: 18px;
}
.soliq-ledger-layout {
  align-items: start;
}
.soliq-ledger-meta {
  display: grid;
  gap: 2px;
}
.soliq-ledger-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.soliq-ledger-amount {
  white-space: nowrap;
}
.soliq-empty {
  text-align: center;
  padding: 28px 16px;
  margin: 0;
  font-weight: 600;
}
.soliq-empty-card {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 32px 20px;
}
.soliq-empty-card h3 { margin: 0; }
.soliq-empty-card p { margin: 0; color: var(--muted); font-weight: 600; max-width: 420px; }
.soliq-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.soliq-search-input,
.soliq-select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.soliq-search-input { flex: 1 1 220px; min-width: 0; }
.soliq-select { min-width: 140px; }
.soliq-subhead { margin-top: 18px; }
.soliq-warehouse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.soliq-chip-teal {
  background: #e8f4f3 !important;
  color: var(--teal) !important;
}
.soliq-day-list,
.soliq-rank-list {
  display: grid;
  gap: 8px;
}
.soliq-day-row,
.soliq-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.soliq-day-row strong,
.soliq-rank-row strong {
  font-size: 13px;
}
.soliq-day-row em,
.soliq-rank-row em {
  font-style: normal;
  font-weight: 800;
}
.soliq-day-row em.is-ok,
.soliq-rank-row em { color: var(--green); }
.soliq-day-row em.is-teal { color: var(--teal); }
.soliq-rank-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
}
.soliq-rank-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f3ef;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}
.soliq-rank-row div {
  display: grid;
  gap: 2px;
}
.soliq-rank-row div span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.soliq-summary-metric.is-income strong { color: var(--green); }
.soliq-summary-metric.is-expense strong { color: var(--amber); }

.plan-chip {
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(35, 123, 120, 0.35);
  color: #eef7ee;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.nav-item.nav-locked {
  opacity: 0.78;
}
.badge.plan-lock {
  background: rgba(194, 123, 40, 0.18);
  color: #f0d7a8;
  font-size: 10px;
}
.plan-lock-panel {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 28px 20px;
}
.plan-lock-panel h3 { margin: 0; }
.plan-lock-panel p { margin: 0; color: var(--muted); font-weight: 600; max-width: 420px; }
.pricing-page { max-width: 1100px; display: grid; gap: 14px; }
.pricing-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  padding: 22px !important;
  background:
    radial-gradient(circle at 12% 20%, rgba(35, 123, 120, 0.16), transparent 42%),
    linear-gradient(135deg, #f4faf7 0%, #ffffff 55%, #eef6f2 100%) !important;
}
.pricing-hero-copy { display: grid; gap: 8px; align-content: start; }
.pricing-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.pricing-hero-copy h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.15;
}
.pricing-hero-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  max-width: 46ch;
}
.pricing-calc {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(35, 123, 120, 0.14);
  align-content: start;
}
.pricing-calc label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.pricing-calc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.pricing-calc-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 18px;
  font-weight: 800;
}
.pricing-calc-result {
  display: grid;
  gap: 4px;
  padding-top: 4px;
}
.pricing-calc-total {
  font-size: 26px;
  font-weight: 900;
  color: var(--teal);
}
.pricing-calc-result small,
.pricing-footnote {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.plan-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 18px !important;
  border: 1px solid var(--line);
  background: #fff;
}
.plan-card.current {
  border-color: var(--teal);
  box-shadow: 0 12px 28px rgba(35, 123, 120, 0.12);
}
.plan-card.plan-pro {
  background: linear-gradient(180deg, #f7fcfa 0%, #fff 40%);
}
.plan-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}
.plan-price {
  display: grid;
  gap: 2px;
}
.plan-price strong {
  font-size: 24px;
  font-weight: 900;
  color: var(--teal);
}
.plan-price span,
.plan-audience,
.plan-limit {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.plan-estimate {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(35, 123, 120, 0.06);
}
.plan-estimate span,
.plan-estimate small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.plan-estimate strong {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}
.plan-features {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.plan-cta { width: 100%; }
.dashboard-farm-report {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 16px 18px !important;
  border: 1px solid rgba(35, 123, 120, 0.18);
  background:
    radial-gradient(circle at 0% 50%, rgba(35, 123, 120, 0.12), transparent 46%),
    #fff !important;
  cursor: pointer;
}
.dashboard-farm-report:hover {
  border-color: rgba(35, 123, 120, 0.35);
  box-shadow: 0 10px 24px rgba(35, 123, 120, 0.1);
}
.dashboard-farm-report-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(35, 123, 120, 0.12);
  color: var(--teal);
}
.dashboard-farm-report-icon .icon { width: 22px; height: 22px; }
.dashboard-farm-report-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.dashboard-farm-report-copy strong {
  font-size: 16px;
  font-weight: 900;
}
.dashboard-farm-report-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.dashboard-farm-report-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-weight: 800;
}
.dashboard-farm-report-meta em {
  font-style: normal;
  font-size: 22px;
}
.dashboard-farm-report-meta .badge.plan-lock {
  font-size: 11px;
}
.farm-report-page,
.sensors-page { display: grid; gap: 14px; }
.farm-report-body { min-height: 220px; }
.farm-report-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 8px 0;
}
.farm-report-empty h3 { margin: 0; }
.farm-report-empty p { margin: 0; color: var(--muted); font-weight: 600; max-width: 56ch; }
.farm-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.farm-report-actions .primary {
  min-width: 200px;
}
.passport-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.passport-header h3 {
  margin: 0;
}
.passport-header p {
  margin: 4px 0 0;
  color: var(--muted);
}
.passport-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.passport-actions .delete-btn {
  color: var(--red);
  border-color: #feb2b2;
  background: #fdf2f2;
}
.genetics-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.genetics-toolbar-actions select {
  min-width: min(220px, 100%);
}
.genetics-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.genetics-form-actions .primary {
  min-width: 140px;
}
.sensors-intro h3 { margin: 0 0 8px; }
.sensors-intro p { margin: 0; color: var(--muted); font-weight: 600; }
.sensors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sensor-card {
  display: grid;
  gap: 8px;
  padding: 18px !important;
}
.sensor-card h4 { margin: 0; font-size: 15px; }
.sensor-card strong { font-size: 28px; font-weight: 900; color: var(--teal); }
.sensor-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.sensor-status {
  justify-self: start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2f6b4f;
  background: rgba(47, 107, 79, 0.1);
  border-radius: 999px;
  padding: 4px 10px;
}
.soliq-summary-metric.primary-metric {
  border: 1px solid rgba(35, 123, 120, 0.25);
  background: rgba(35, 123, 120, 0.08);
}
@media (max-width: 900px) {
  .plan-grid { grid-template-columns: 1fr; }
  .pricing-hero { grid-template-columns: 1fr; }
  .pricing-calc-row { grid-template-columns: 1fr; }
  .sensors-grid { grid-template-columns: 1fr; }
}
.writeoff-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 20, 0.45); padding: 16px;
}
.writeoff-dialog { width: min(520px, 100%); padding: 18px; }
@media (max-width: 900px) {
  .ledger-toolbar { flex-direction: column; }
  .ledger-row, .warehouse-item-card { grid-template-columns: 1fr; }
  .soliq-warehouse-actions { justify-content: flex-start; }
  .soliq-ledger-layout { grid-template-columns: 1fr; }
}

.genetics-page .ledger-kpi small { color: var(--muted); font-size: 12px; }
.genetics-page .chip.green { background: rgba(34, 160, 107, 0.12); color: var(--green); }
.genetics-page .chip.amber { background: rgba(214, 158, 46, 0.14); color: var(--amber); }
.genetics-page .chip.red { background: rgba(220, 80, 80, 0.12); color: var(--red); }
.genetics-page .profit-plus,
.genetics-page strong.green { color: var(--green); }
.genetics-page strong.amber { color: var(--amber); }
.genetics-page strong.red { color: var(--red); }
.genetics-lines-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.genetics-line-list h4 { margin: 0 0 8px; font-size: 14px; }
.genetics-line-list ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.genetics-line-list button,
button.linkish {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.genetics-line-list button:hover,
button.linkish:hover { color: var(--teal); text-decoration: underline; }
.pedigree-tree {
  overflow-x: auto;
  padding: 8px 0 4px;
}
.pedigree-branch {
  display: grid;
  justify-items: center;
  gap: 12px;
}
.pedigree-parents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  position: relative;
  padding-top: 8px;
}
.pedigree-parents::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  border-top: 1px solid var(--line);
}
.pedigree-node {
  min-width: 120px;
  max-width: 180px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  font: inherit;
}
.pedigree-node:hover { border-color: var(--teal); }
.pedigree-node.empty {
  opacity: 0.55;
  cursor: default;
  min-height: 56px;
  place-items: center;
}
.pedigree-node strong { font-size: 14px; }
.pedigree-node span,
.pedigree-node small { color: var(--muted); font-size: 12px; }
.pedigree-role {
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal) !important;
}
@media (max-width: 900px) {
  .genetics-lines-split { grid-template-columns: 1fr; }
}

.exam-side-panels {
  display: grid;
  gap: 16px;
}
.vaccine-panel { padding: 14px; }
.vaccine-search { margin: 8px 0 12px; }
.vaccine-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.vaccine-item {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.vaccine-item.active,
.vaccine-item:hover { border-color: var(--teal); }
.vaccine-item span,
.vaccine-item em { color: var(--muted); font-size: 12px; font-style: normal; }
.vaccine-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.vaccine-details .primary,
.vaccine-details .secondary { width: fit-content; }

/* Soliq-style home hub */
.soliq-hub {
  display: grid;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}

.soliq-summary {
  padding: 22px 18px 16px;
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 0%, #e8f5f1 0%, #ffffff 55%, #ffffff 100%);
  border: 1px solid rgba(220, 230, 222, 0.9);
}

.soliq-summary-main {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 8px 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.soliq-summary-main span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.soliq-summary-main strong {
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.soliq-summary-main small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.soliq-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.soliq-summary-metric {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 6px 16px rgba(29, 54, 40, 0.04);
}

button.soliq-summary-metric {
  cursor: pointer;
}

button.soliq-summary-metric:hover {
  border-color: #b7d0bf;
  background: #f7fbf8;
}

.soliq-summary-metric span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.soliq-summary-metric strong {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.soliq-summary-metric strong.is-ok { color: var(--green); }
.soliq-summary-metric strong.is-warn { color: var(--amber); }
.soliq-summary-metric strong.is-teal { color: var(--teal); }
.soliq-summary-metric.has-warn {
  border-color: #f0c4c1;
  background: #fff7f6;
}
.soliq-summary-metric.has-warn strong { color: var(--red); }

.soliq-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(29, 54, 40, 0.06);
}

.soliq-quick-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.soliq-quick-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f4f0;
  color: var(--teal);
}

.soliq-quick-icon .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.soliq-section-title {
  margin: 2px 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.soliq-section-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.soliq-section-link {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.soliq-services,
.soliq-recommend {
  display: grid;
  gap: 0;
}

.soliq-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.soliq-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  min-height: 112px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(29, 54, 40, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.soliq-tile:hover {
  border-color: #b7d0bf;
  box-shadow: 0 12px 28px rgba(29, 54, 40, 0.1);
  transform: translateY(-2px);
}

.soliq-tile-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e7f3ef;
  color: var(--teal);
}

.soliq-tile-icon .icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.soliq-tile strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.soliq-tile-count {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--teal);
}

.soliq-tile.has-warn {
  border-color: #f0c4c1;
}

.soliq-tile.has-warn .soliq-tile-icon {
  background: #fff1f0;
  color: var(--red);
}

.soliq-tile.has-warn .soliq-tile-count {
  color: var(--red);
}

.soliq-recommend .panel {
  border-radius: 18px;
}

.soliq-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.soliq-filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.soliq-filter-chip.active {
  border-color: var(--teal);
  background: #e7f3ef;
  color: var(--teal);
}

.female-only-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  margin-top: 4px;
  border: 1px dashed #c5d7cb;
  border-radius: var(--radius);
  background: #f6faf7;
  grid-column: 1 / -1;
}

.female-only-fields.is-hidden,
.female-only-fields[hidden] {
  display: none !important;
}

.female-only-fields .field-group-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.animal-class-tags .tag-milk {
  background: #e7f3ff;
  color: #2f638f;
}

.animal-class-tags .tag-mother {
  background: #eef8f0;
  color: var(--green);
}

.animal-class-tags .tag-dry {
  background: #fff4e8;
  color: var(--amber);
}

@media (max-width: 720px) {
  .soliq-hub {
    max-width: none;
  }

  .soliq-quick {
    border-radius: 20px;
  }

  .soliq-summary-main strong {
    font-size: 36px;
  }
}

@media (max-width: 980px) {
  .female-only-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .soliq-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .soliq-tile {
    min-height: 100px;
    padding: 14px 8px;
    border-radius: 16px;
  }

  .soliq-tile strong {
    font-size: 12px;
  }

  .soliq-quick-item span:last-child {
    font-size: 10px;
  }

  .female-only-fields {
    grid-template-columns: 1fr;
  }
}

.finance-chart-block {
  display: grid;
  gap: 14px;
}

.finance-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 13px;
  color: var(--muted);
}

.finance-chart-legend .is-income strong { color: var(--green); }
.finance-chart-legend .is-expense strong { color: var(--amber); }
.finance-chart-legend .profit-plus { color: var(--green); }
.finance-chart-legend .profit-minus { color: #c2410c; }

.finance-chart-plot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 160px;
  overflow-x: auto;
  padding: 8px 4px 0;
}

.finance-chart-col {
  flex: 1 0 28px;
  min-width: 28px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.finance-chart-bars {
  height: 120px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.finance-bar {
  width: 10px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.finance-bar.income { background: var(--green); }
.finance-bar.expense { background: var(--amber); }

.finance-chart-col small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.staff-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 12px;
}

.staff-people-list,
.staff-task-list,
.staff-notify-list {
  display: grid;
  gap: 10px;
}

.staff-person-card,
.staff-task-card,
.staff-notify-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.staff-person-card strong,
.staff-task-card strong,
.staff-notify-item strong {
  display: block;
  margin-bottom: 2px;
}

.staff-person-card p,
.staff-task-card p,
.staff-notify-item span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.staff-salary {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.staff-notify-item.overdue,
.staff-task-card.overdue {
  border-color: #fecaca;
  background: #fff7f6;
}

.staff-notify-item.today,
.staff-task-card.today {
  border-color: #fde68a;
  background: #fffbeb;
}

.staff-notify-item em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--amber);
}

.staff-notify-item.overdue em {
  color: #c2410c;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .staff-person-card,
  .staff-task-card {
    flex-direction: column;
    align-items: stretch;
  }
}
