:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --ink: #18201b;
  --muted: #657067;
  --brand: #1f7a4c;
  --brand-dark: #155937;
  --line: #dfe4dc;
  --panel: #ffffff;
  --warn: #b45309;
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--brand-dark);
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary {
  background: #eef4ef;
  color: var(--brand-dark);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.menuButton {
  min-width: 82px;
}

.mainMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: clamp(16px, 4vw, 40px);
  width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgb(24 32 27 / 14%);
}

.menuItem {
  width: 100%;
  background: #fff;
  color: var(--ink);
  text-align: left;
  border: 1px solid transparent;
}

.menuItem:hover:not(:disabled) {
  color: var(--brand-dark);
  background: #eef4ef;
  border-color: var(--line);
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 16px clamp(14px, 4vw, 32px) 44px;
}

.view {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.view.active {
  display: block;
}

.sectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sectionHead.compact {
  margin-top: 8px;
}

.sectionHead h3,
.sectionHead h4 {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--brand-dark);
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 10px;
}

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

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

.fieldLabel {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.check input {
  width: auto;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf8;
}

.stat strong {
  display: block;
  font-size: 24px;
  color: var(--brand-dark);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.list {
  display: grid;
  gap: 10px;
}

.row,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.row strong {
  display: block;
}

.row small,
.panel {
  color: var(--muted);
}

.price {
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.detailActions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}

.detailActions label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.priceSummary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf8;
}

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

.priceSummary strong {
  color: var(--brand-dark);
  font-size: 20px;
}

.priceSummary span {
  color: var(--muted);
  font-size: 13px;
}

.priceChart {
  width: 100%;
  min-height: 220px;
  margin: 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chartAxis {
  stroke: #ccd6ce;
  stroke-width: 1;
}

.chartLine {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receiptDot {
  fill: var(--brand);
}

.promoDot {
  fill: var(--warn);
}

.chartLabel {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notificationFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.notificationFilter.active {
  background: var(--brand);
  color: #fff;
}

.notificationRow.unread {
  border-color: var(--brand);
  background: #f5fbf6;
}

.notificationRow p {
  margin: 8px 0 0;
  color: var(--ink);
}

.warning {
  color: var(--warn);
}

.hidden {
  display: none !important;
}

.cameraBox {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.cameraActions button {
  min-height: 48px;
}

.mediaPreview {
  width: 100%;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101510;
  object-fit: contain;
}

.photoGallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.photoTile {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 80px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photoTile img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: #101510;
}

.photoTile small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.photoTile button {
  min-height: 36px;
  margin-top: 6px;
  padding: 0 12px;
}

.decisionSheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgb(24 32 27 / 36%);
}

.decisionPanel {
  width: min(520px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgb(24 32 27 / 18%);
}

.decisionPanel h3,
.decisionPanel p {
  margin: 0;
}

.decisionPanel p {
  color: var(--muted);
}

.storeSuggestion {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b7d5c2;
  border-radius: 8px;
  background: #f5fbf6;
}

.storeSuggestion strong,
.storeSuggestion small {
  display: block;
}

.storeSuggestion small {
  color: var(--muted);
}

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

.formGrid label,
.itemEditor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.itemsEditor {
  display: grid;
  gap: 10px;
}

.itemEditor {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(100px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.confidence {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .itemEditor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 34px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

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

  .row,
  .formGrid,
  .detailActions,
  .priceSummary,
  .inline,
  .inline.three,
  .stats,
    .itemEditor {
    grid-template-columns: 1fr;
  }

  .price {
    text-align: left;
  }

  .photoTile {
    grid-template-columns: 64px 1fr;
  }
}
