:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #203430;
  background: #f6f7f4;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.055em;
  line-height: 1.12;
}
h2 {
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 1rem;
}
.muted {
  color: #708079;
}
.eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #86968e;
  margin-bottom: 0.5rem;
}
.error {
  color: #b44535;
  min-height: 1.3em;
  font-size: 0.87rem;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}
.sidebar {
  background: #172e2b;
  color: #d8e5dc;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1.55rem 1.2rem 2rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  background: #d3e779;
  color: #203a2f;
  border-radius: 0.65rem;
  font-weight: 900;
  font-size: 1.35rem;
  box-shadow: inset 0 -4px #a8bc55;
}
.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}
.sidebar-brand strong {
  color: white;
  letter-spacing: -0.04em;
  font-size: 1.17rem;
}
.sidebar-brand small {
  font-size: 0.7rem;
  color: #9eb1a9;
}
.sidebar nav {
  padding: 0 0.75rem;
  display: grid;
  gap: 0.2rem;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #afc0b8;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
  width: 100%;
}
.nav-item:hover,
.nav-item.active {
  background: #2b4740;
  color: white;
}
.nav-icon {
  font-size: 1.08rem;
  width: 1.3rem;
  text-align: center;
}
.sidebar-foot {
  margin-top: auto;
  padding: 1.2rem 1.5rem;
  color: #9eb1a9;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid #36534b;
}
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 100%;
  background: #cde574;
}
.app-body {
  min-width: 0;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #e6ece7;
  min-height: 112px;
  padding: 1.7rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar h1 {
  margin: 0;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.online-state {
  font-size: 0.75rem;
  color: #668078;
  white-space: nowrap;
}
.online-state:before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  background: #67ae7a;
  border-radius: 100%;
  margin-right: 0.45rem;
}
.online-state.offline:before {
  background: #db9a66;
}
.button {
  border: 1px solid transparent;
  border-radius: 0.55rem;
  padding: 0.68rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
  min-height: 42px;
}
.button.primary {
  background: #284e3c;
  color: #fff;
}
.button.primary:hover {
  background: #1c3d30;
}
.button.secondary {
  background: #fff;
  color: #294639;
  border-color: #d9e4dd;
}
.button.secondary:hover {
  background: #edf3ed;
}
.button.small {
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
  min-height: 34px;
}
.button.wide {
  width: 100%;
}
.icon-button {
  background: #f0f4ee;
  border: 1px solid #e1e8df;
  border-radius: 0.55rem;
  color: #2a4c3b;
  font-size: 1.45rem;
  line-height: 1;
  width: 42px;
  height: 42px;
}
.icon-button:hover {
  background: #e1ecd9;
}
main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 2.5rem 5rem;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}
.section-head h2 {
  margin: 0;
}
.section-head p {
  margin: 0.4rem 0 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat {
  background: #fff;
  border: 1px solid #e6ece7;
  border-radius: 0.85rem;
  padding: 1.25rem 1.35rem;
}
.stat small {
  display: block;
  color: #6d8076;
  font-size: 0.78rem;
  font-weight: 650;
}
.stat strong {
  display: block;
  font-size: 2rem;
  letter-spacing: -0.055em;
  margin-top: 0.45rem;
}
.stat .tag {
  margin-top: 0.75rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 10rem;
  padding: 0.27rem 0.55rem;
  background: #eaf1e4;
  color: #376342;
  font-size: 0.69rem;
  font-weight: 750;
}
.tag.warn {
  background: #fff2db;
  color: #a36c19;
}
.tag.blue {
  background: #e8f1f5;
  color: #3f6f83;
}
.panel {
  background: #fff;
  border: 1px solid #e6ece7;
  border-radius: 0.85rem;
  overflow: hidden;
}
.panel + .panel {
  margin-top: 1rem;
}
.panel-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #edf0ec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.panel-header h2,
.panel-header h3 {
  margin: 0;
}
.panel-body {
  padding: 1.2rem 1.25rem;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr);
  gap: 1rem;
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #edf0ec;
  min-width: 0;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row:hover {
  background: #fbfcfa;
}
.row-symbol {
  width: 2.65rem;
  height: 2.65rem;
  flex: none;
  border-radius: 0.6rem;
  background: #eff4ea;
  color: #467252;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 0.92rem;
}
.row-symbol.amber {
  background: #fdf2dd;
  color: #a6732c;
}
.row-symbol.blue {
  background: #edf3f7;
  color: #4b7d92;
}
.row-main {
  min-width: 0;
  flex: 1;
}
.row-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.91rem;
}
.row-main small {
  display: block;
  color: #7a8980;
  margin-top: 0.22rem;
  font-size: 0.76rem;
}
.environmental-history .row-main small {
  overflow-wrap: anywhere;
}
.row-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}
.row-number {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}
.row-number small {
  font-size: 0.7rem;
  color: #8a978e;
  font-weight: 500;
}
.toolbar {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  align-items: center;
}
.search-field {
  flex: 1;
  max-width: 440px;
}
.search-field input,
input,
select,
textarea {
  border: 1px solid #dce5dc;
  border-radius: 0.55rem;
  background: #fff;
  color: #243c31;
  padding: 0.72rem 0.85rem;
  width: 100%;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #75a97d;
  box-shadow: 0 0 0 3px #75a97d25;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.empty {
  padding: 3rem 1.25rem;
  text-align: center;
  color: #7c8d81;
}
.empty .empty-icon {
  font-size: 2.25rem;
  display: block;
  margin-bottom: 0.7rem;
  color: #a7b9a7;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.quick-action {
  border: 1px solid #e2e9e1;
  background: #f8faf6;
  border-radius: 0.55rem;
  padding: 0.9rem;
  text-align: left;
  color: #314c3d;
  font-weight: 700;
}
.quick-action:hover {
  background: #edf4e9;
}
.order-card {
  border-bottom: 1px solid #edf0ec;
  padding: 1.1rem 1.25rem;
}
.order-card:last-child {
  border: 0;
}
.order-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}
.order-top strong {
  font-size: 0.94rem;
}
.order-top small {
  display: block;
  color: #7b8a80;
  margin-top: 0.25rem;
}
.order-lines {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.5rem;
}
.order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #f8faf7;
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
}
.order-line .button {
  margin-left: auto;
}
.activity-row {
  display: flex;
  gap: 0.7rem;
  align-items: start;
  padding: 0.8rem 0;
  border-bottom: 1px solid #edf0ec;
  font-size: 0.83rem;
}
.activity-row:last-child {
  border: 0;
}
.activity-row time {
  margin-left: auto;
  white-space: nowrap;
  color: #8b998e;
  font-size: 0.72rem;
}
.notice {
  background: #eff4eb;
  border: 1px solid #d9e9d5;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  color: #49644e;
  font-size: 0.82rem;
  line-height: 1.5;
}
.notice strong {
  display: block;
  margin-bottom: 0.2rem;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #172e2b;
  padding: 1.5rem;
}
.login-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2.3rem;
  width: min(100%, 420px);
  box-shadow: 0 24px 70px #091c1b55;
}
.login-card .brand-mark {
  margin-bottom: 2rem;
}
.login-card h1 {
  font-size: 2.2rem;
}
.login-card .muted {
  line-height: 1.5;
  margin-bottom: 0.9rem;
}
.login-card #login-server {
  overflow-wrap: anywhere;
}
.login-card label,
.field label {
  display: block;
  font-size: 0.77rem;
  font-weight: 750;
  margin-bottom: 0.45rem;
}
.login-card input {
  margin-bottom: 1rem;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.2rem 0;
  color: #708079;
  font-size: 0.85rem;
}
dialog {
  border: 0;
  border-radius: 0.95rem;
  box-shadow: 0 24px 80px #14271f44;
  width: min(95vw, 480px);
  max-height: min(90vh, 820px);
  padding: 0;
  color: #203430;
}
dialog::backdrop {
  background: #14271f99;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 1.35rem 1.5rem 1rem;
  border-bottom: 1px solid #edf0ec;
}
.modal-head h2 {
  margin: 0;
}
#modal-fields {
  padding: 1.3rem 1.5rem 0.4rem;
  display: grid;
  gap: 1rem;
  max-height: 60vh;
  overflow: auto;
}
.field small {
  display: block;
  color: #88988d;
  margin-top: 0.35rem;
  font-size: 0.7rem;
}
.modal-actions {
  display: flex;
  justify-content: end;
  gap: 0.6rem;
  padding: 1.2rem 1.5rem 0;
}
#modal-error {
  padding: 0 1.5rem 1rem;
  margin: 0.6rem 0 0;
}
.bottom-nav {
  display: none;
}
#toast {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  background: #1d3b2f;
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 0.55rem;
  box-shadow: 0 8px 30px #14271f33;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s;
  pointer-events: none;
  z-index: 99;
  font-size: 0.85rem;
}
#toast.show {
  opacity: 1;
  transform: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .topbar {
    padding: 1.3rem 1.5rem;
  }
  main {
    padding: 1.5rem;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}
.spaced-top {
  margin-top: 1rem;
}
.spaced-section {
  margin-top: 1.5rem;
}
.button-adjacent {
  margin-left: 0.5rem;
}
.camera-preview {
  width: 100%;
  border-radius: 0.5rem;
}
@media (max-width: 680px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    min-height: 88px;
    padding: 1rem 1.15rem;
  }
  .topbar h1 {
    font-size: 1.55rem;
  }
  .top-actions {
    gap: 0.4rem;
  }
  .online-state {
    display: none;
  }
  #new-button {
    padding: 0.5rem 0.7rem;
    font-size: 0.76rem;
    min-height: 38px;
  }
  .icon-button {
    width: 38px;
    height: 38px;
  }
  main {
    padding: 1.1rem 1rem 6.2rem;
  }
  .stats {
    gap: 0.55rem;
    margin-bottom: 1.4rem;
  }
  .stat {
    padding: 0.95rem;
  }
  .stat strong {
    font-size: 1.65rem;
  }
  .stat small {
    font-size: 0.7rem;
  }
  .panel-header {
    padding: 1rem;
  }
  .list-row {
    padding: 0.9rem 1rem;
    gap: 0.65rem;
  }
  .row-symbol {
    width: 2.3rem;
    height: 2.3rem;
  }
  .row-right {
    gap: 0.3rem;
  }
  .row-right .button {
    font-size: 0.7rem;
    padding: 0.3rem 0.45rem;
  }
  .stock-row {
    flex-wrap: wrap;
  }
  .stock-row .row-right {
    width: 100%;
    justify-content: flex-end;
  }
  .order-card {
    padding: 1rem;
  }
  .order-line {
    flex-wrap: wrap;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e1e8df;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0.4rem 0.2rem calc(0.4rem + env(safe-area-inset-bottom));
    z-index: 10;
  }
  .bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.3rem 0.1rem;
    text-align: center;
    font-size: 0.6rem;
    flex: 0 0 68px;
    color: #819187;
    min-width: 58px;
  }
  .bottom-nav .nav-item.active {
    background: transparent;
    color: #2f6044;
  }
  .bottom-nav .nav-icon {
    font-size: 1.25rem;
    width: auto;
  }
  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }
  #toast {
    bottom: 5.2rem;
    left: 1rem;
    right: 1rem;
  }
}
