:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #22392f;
  background: #f5f6f2;
  font-synthesis: none;
  --green: #173f35;
  --muted: #718078;
  --line: #e1e6de;
  --lime: #c8dd9c;
  --red: #ac5145;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #92b65e;
  outline-offset: 3px;
}
button {
  border: 0;
  border-radius: 9px;
  padding: 12px 17px;
  min-height: 44px;
  background: var(--green);
  color: white;
  font-weight: 600;
}
button.secondary {
  background: white;
  color: var(--green);
  border: 1px solid var(--line);
}
button.ghost {
  background: transparent;
  color: var(--muted);
}
button.danger {
  color: var(--red);
  background: #faebe6;
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--green);
  color: #fff;
  padding: 30px 20px;
  position: fixed;
  width: 240px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.6px;
}
.brand img {
  width: 42px;
  height: 42px;
}
.brand small {
  font-size: 10px;
  letter-spacing: 2px;
  color: #c6d1bc;
  display: block;
  text-transform: uppercase;
  margin-top: 3px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #9db4a5;
  margin: 40px 14px 13px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav button {
  background: none;
  color: #c8d6cf;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 14px;
  font-weight: 500;
}
.nav button.active {
  background: #c8dd9c;
  color: #193c31;
}
.ico {
  font-size: 20px;
  width: 24px;
  text-align: center;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #38584b;
  padding-top: 20px;
  font-size: 12px;
  color: #c3d3c9;
  line-height: 1.7;
}
.sidebar-foot strong {
  color: white;
  display: block;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 84px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.farm-select {
  border: none;
  font-weight: 650;
  color: var(--green);
  max-width: 280px;
  background: white;
}
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e9eedf;
  color: #405a38;
  font-weight: 700;
}
.content {
  padding: 34px 40px;
  max-width: 1560px;
  margin: auto;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  font-weight: 650;
  margin-bottom: 9px;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.9px;
  margin: 0 0 9px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  margin: 0;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  margin: 0 0 6px;
}
p {
  line-height: 1.55;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.period {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 12px;
}
.period input {
  border: 0;
  padding: 0;
  min-height: 28px;
  width: 132px;
}
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #e4dfc7;
  background: #faf7e9;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #766535;
  margin: 20px 0;
}
.notice strong {
  font-weight: 650;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
}
.metric.featured {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.featured .metric-label {
  color: #c9d7c9;
}
.metric-value {
  font-size: 26px;
  letter-spacing: -0.8px;
  font-weight: 650;
  margin: 17px 0 9px;
  white-space: nowrap;
}
.metric-note {
  font-size: 11px;
  color: var(--muted);
}
.featured .metric-note {
  color: var(--lime);
}
.grid-two {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.grid-two .panel {
  margin: 0;
}
.panel-head {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0 0;
}
.panel-body {
  padding: 0 24px 24px;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  margin-right: 5px;
  background: var(--green);
}
.dot.expense {
  background: #becf9e;
}
.chart {
  height: 205px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  padding-top: 15px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 49px,
    #f1f3ed 50px
  );
}
.chart-col {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 100%;
  flex: 1;
  position: relative;
  padding-bottom: 23px;
}
.bar {
  width: 23px;
  max-width: 35%;
  border-radius: 4px 4px 0 0;
  background: var(--green);
  min-height: 0;
}
.bar.expense {
  background: #becf9e;
}
.chart-col span {
  position: absolute;
  bottom: 3px;
  font-size: 10px;
  color: var(--muted);
}
.category-row {
  margin: 0 0 20px;
}
.category-label {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  font-size: 12px;
  margin-bottom: 8px;
}
.track {
  height: 7px;
  background: #f0f2eb;
  border-radius: 5px;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  background: #73946a;
  border-radius: 5px;
}
.filters {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}
.filters input {
  flex: 1;
  min-width: 140px;
}
.filters select {
  max-width: 200px;
}
input,
select,
textarea {
  border: 1px solid #d9e0d5;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  color: #263e32;
  max-width: 100%;
}
textarea {
  min-height: 85px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #99b780;
  outline-offset: 1px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: left;
  padding: 13px 24px;
  background: #fafbf8;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 16px 24px;
  border-top: 1px solid #edf0e8;
}
td strong {
  display: block;
  font-weight: 600;
}
td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 650;
}
.income {
  color: #2d7554;
}
.expense-text {
  color: var(--red);
}
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #eff1e9;
  color: #6b775c;
  white-space: nowrap;
}
.badge.paid {
  background: #eaf4ec;
  color: #3e7955;
}
.badge.overdue {
  background: #faebe7;
  color: #a64f40;
}
.badge.pending {
  background: #f6efd9;
  color: #97752c;
}
.badge.review {
  background: #f5edde;
  color: #8a6e39;
}
.small-btn {
  font-size: 11px;
  padding: 7px 11px;
  min-height: 36px;
}
.empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.footer-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 24px;
}
.milk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.milk-card {
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.milk-card .price {
  font-size: 29px;
  margin: 15px 0 8px;
  font-weight: 650;
}
.milk-card p {
  font-size: 12px;
  color: var(--muted);
}
.milk-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 18px;
}
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-story {
  background: var(--green);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px 70px;
}
.login-story h1 {
  font-size: 52px;
  line-height: 1.15;
  max-width: 500px;
  letter-spacing: -2px;
}
.login-story p {
  color: #cad7c6;
  max-width: 400px;
}
.field-art {
  height: 170px;
  position: relative;
  overflow: hidden;
  margin-top: 40px;
}
.field-art i {
  display: block;
  position: absolute;
  border: 1px solid #7b9866;
  border-radius: 50%;
  width: 650px;
  height: 190px;
  transform: rotate(-18deg);
  left: -60px;
  top: 20px;
}
.field-art i:nth-child(2) {
  top: 50px;
}
.field-art i:nth-child(3) {
  top: 80px;
}
.field-art i:nth-child(4) {
  top: 110px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form form {
  width: 100%;
  max-width: 360px;
}
.login-form h2 {
  font-size: 27px;
  letter-spacing: -0.7px;
}
.login-form p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 30px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}
.login-form label {
  margin-bottom: 17px;
}
.login-form button {
  width: 100%;
  margin-top: 8px;
}
.form-error {
  color: #a74032;
  font-size: 12px;
  min-height: 18px;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
dialog {
  width: 640px;
  max-width: calc(100% - 24px);
  max-height: 90dvh;
  border: 0;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 24px 90px #0003;
  color: inherit;
}
dialog::backdrop {
  background: #102c2580;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.full {
  grid-column: 1/-1;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 18px 24px;
}
.help {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}
.loan-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.loan-row span {
  font-size: 12px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: white;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 5px 30px #0002;
  font-size: 13px;
  z-index: 10;
  display: none;
  max-width: 90vw;
}
.mobile-brand {
  display: none;
}
.list-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.list-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.list-card p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}
.link-button {
  background: none;
  color: var(--green);
  padding: 8px;
  font-size: 12px;
}
.audit-detail {
  white-space: pre-wrap;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  font-size: 12px;
}
.toggle-row select {
  font-size: 12px;
}
@media (min-width: 1500px) {
  .metric-value {
    font-size: 30px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 200px;
    padding: 25px 14px;
  }
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .metric-value {
    font-size: 22px;
  }
  .grid-two {
    grid-template-columns: 1.3fr 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  .milk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  td,
  th {
    padding: 14px 16px;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 0;
    background: var(--green);
  }
  .sidebar > .brand,
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
    gap: 3px;
    padding: 9px 12px;
  }
  .nav button {
    white-space: nowrap;
    font-size: 12px;
    flex-shrink: 0;
    padding: 9px 11px;
    gap: 6px;
  }
  .nav .ico {
    font-size: 16px;
    width: 17px;
  }
  .topbar {
    height: 67px;
    padding: 0 17px;
  }
  .farm-select {
    max-width: 190px;
    font-size: 13px;
  }
  .account .user-name {
    display: none;
  }
  .content {
    padding: 25px 17px;
  }
  .page-heading {
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 25px;
  }
  .page-heading > .actions {
    width: 100%;
    justify-content: space-between;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .metric-value {
    font-size: 25px;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .panel-head {
    padding: 20px;
  }
  .panel-body {
    padding: 0 20px 20px;
  }
  .filters {
    padding: 0 17px 17px;
  }
  .list-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 28px;
    min-height: 230px;
  }
  .login-story h1 {
    font-size: 33px;
    max-width: 390px;
    margin-top: 32px;
  }
  .login-story p,
  .login-story footer,
  .field-art {
    display: none;
  }
  .login-form {
    padding: 35px 24px;
  }
  .login-form form {
    max-width: 440px;
  }
  .responsive-table table,
  .responsive-table tbody {
    display: block;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 15px 18px;
    border-top: 1px solid var(--line);
    gap: 8px;
  }
  .responsive-table td {
    padding: 0;
    border: 0;
    align-self: center;
  }
  .responsive-table td:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .responsive-table td.amount {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  .responsive-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .responsive-table td:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }
  .responsive-table td:last-child {
    grid-column: 2;
    grid-row: 2/4;
    text-align: right;
  }
  .responsive-table td:nth-child(2) small {
    display: inline;
    margin-right: 5px;
  }
  .metric-note {
    line-height: 1.6;
  }
}
@media (max-width: 420px) {
  .metric {
    padding: 15px 12px;
  }
  .metric-value {
    font-size: 21px;
  }
  .metric-label {
    font-size: 11px;
  }
  .milk-grid,
  .list-cards {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .dialog-body {
    padding: 20px;
  }
  .account {
    gap: 2px;
  }
  .account .avatar {
    display: none;
  }
  .period {
    padding: 7px;
  }
  .actions > button {
    padding: 12px;
  }
  .notice {
    padding: 12px;
  }
  .legend {
    gap: 7px;
    font-size: 10px;
  }
  .panel-head {
    padding: 17px;
  }
}

/* Keep all twelve monthly columns visible on compact screens. */
.chart-col {
  min-width: 0;
}
@media (max-width: 800px) {
  .chart {
    gap: 4px;
  }
  .chart-col {
    gap: 2px;
  }
  .chart-col span {
    font-size: 8px;
  }
}
.overview-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}
.overview-filters .actions {
  align-items: end;
}
.overview-filters label {
  min-width: 110px;
}
.overview-filters p {
  margin: 0;
  text-align: right;
}
.overview-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.overview-insights article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #eef2e8;
  border-radius: 10px;
}
.overview-insights strong {
  display: block;
  font-size: 22px;
  margin: 8px 0;
  letter-spacing: -0.5px;
}
.overview-insights small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
button.month-column {
  background: transparent;
  border-radius: 3px;
  padding: 0 0 23px;
  min-height: 0;
  color: inherit;
}
button.month-column.selected {
  background: #edf2e5;
  outline: 1px solid #acc388;
}
.month-column:hover {
  background: #f1f5eb;
}
.no-data-marker {
  position: absolute;
  bottom: 30px;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}
.selected-row {
  background: #f1f5eb;
}
.variation-cell {
  font-size: 11px;
  min-width: 180px;
}
.monthly-indicators td {
  padding: 11px 18px;
}
@media (max-width: 800px) {
  .overview-filters {
    align-items: start;
    flex-direction: column;
    padding: 15px;
  }
  .overview-filters .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 85px minmax(0, 1fr);
  }
  .overview-filters label {
    min-width: 0;
  }
  .overview-filters p {
    text-align: left;
  }
  .overview-insights {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .overview-insights article {
    padding: 14px 17px;
  }
  .monthly-indicators th,
  .monthly-indicators td {
    padding: 10px;
  }
}

.entries-scroll {
  max-height: min(480px, 65vh);
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
.entries-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.entries-scroll:focus-visible {
  outline: 2px solid #99b780;
  outline-offset: -2px;
}
