:root {
  color-scheme: light;
  --bg: #f7f3ed;
  --panel: #fffaf2;
  --ink: #20201d;
  --muted: #746d62;
  --line: #e4d8c8;
  --accent: #1f7a5c;
  --accent-ink: #ffffff;
  --warn: #b84b31;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  padding: 0 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(247, 243, 237, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

.brand small {
  display: block;
  color: var(--muted);
}

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px 14px 88px;
}

.login-panel,
.panel,
.summary-grid article,
.product-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(32, 32, 29, 0.04);
}

.login-panel {
  max-width: 420px;
  margin: 42px auto;
  padding: 22px;
}

.login-panel h1,
.panel h1,
.panel h2 {
  margin: 0 0 8px;
}

.login-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffe9e2;
  color: var(--warn);
}

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

.summary-grid article {
  padding: 14px;
}

.summary-grid small {
  display: block;
  color: var(--muted);
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}

.panel {
  margin: 12px 0;
  padding: 14px;
}

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

.section-title h1,
.section-title h2 {
  margin: 0;
}

.section-title span,
.section-title a {
  color: var(--muted);
  font-size: 0.92rem;
}

.product-grid,
.two-col {
  display: grid;
  gap: 12px;
}

.product-tile {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-tile strong {
  font-size: 1.15rem;
}

.product-tile span {
  color: var(--muted);
}

.inline {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}

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

.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.compact {
  gap: 8px;
}

.primary,
button[type="submit"] {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}

.icon-button {
  background: #fff;
  color: var(--ink);
}

.movement-list,
.table-list {
  display: grid;
  gap: 8px;
}

.movement,
.table-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.movement span,
.table-list span {
  min-width: 0;
  color: var(--muted);
}

.movement strong,
.table-list strong {
  flex: 0 0 auto;
}

.muted strong {
  color: var(--warn);
}

.bottom-nav {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.96);
  backdrop-filter: blur(10px);
}

.bottom-nav a {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

@media (min-width: 760px) {
  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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