:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #61706b;
  --line: #d9e2df;
  --panel: #ffffff;
  --bg: #eef4f1;
  --accent: #1f6f5b;
  --accent-strong: #155845;
  --danger: #b73535;
  --warn: #b2771c;
  --shadow: 0 12px 30px rgba(21, 44, 38, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 700;
}

.button-link {
  display: inline-grid;
  place-items: center;
  flex: 1;
  min-height: 46px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

button.secondary {
  background: #e0ece8;
  color: var(--accent-strong);
}

.button-link.secondary {
  background: #e0ece8;
  color: var(--accent-strong);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.55;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 91, 0.16);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.05rem;
}

.login-view,
.app-view {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.login-view {
  display: grid;
  align-content: center;
  min-height: 100vh;
  gap: 22px;
}

.brand,
.topbar,
.inventory-head,
.section-head,
.button-row,
.search-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar,
.inventory-head,
.section-head {
  justify-content: space-between;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.topbar {
  padding: 8px 0 14px;
}

.icon-button {
  min-height: 40px;
  background: #25312e;
}

.status-strip {
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #e0ece8;
  color: var(--accent-strong);
  font-weight: 700;
}

.status-strip.bad {
  background: #fde8e8;
  color: var(--danger);
}

.inventory-panel,
.search-panel {
  margin-bottom: 12px;
}

.button-row button {
  flex: 1;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.search-line input {
  min-width: 0;
}

.results,
.count-list {
  display: grid;
  gap: 8px;
}

.product-card,
.count-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.product-card {
  text-align: left;
  color: var(--ink);
}

.product-card strong,
.count-card strong {
  font-size: 0.98rem;
}

.meta-line {
  color: var(--muted);
  font-size: 0.86rem;
}

.selected-product {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.pill {
  min-width: 36px;
  text-align: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e0ece8;
  color: var(--accent-strong);
  font-weight: 800;
}

.message {
  min-height: 20px;
  color: var(--warn);
  font-weight: 700;
}

#scanner {
  display: grid;
  gap: 10px;
}

#scannerVideo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #111;
  border-radius: 8px;
  object-fit: cover;
}

@media (max-width: 620px) {
  .login-view,
  .app-view {
    padding: 14px;
  }

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

  .inventory-head {
    align-items: flex-start;
  }
}
:root {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

.theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border: 1px solid #b8c8c3;
  border-radius: 50%;
  background: #173e35;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 5px 18px rgb(0 0 0 / 18%);
  cursor: pointer;
}

.app-credits {
  max-width: 1080px;
  margin: 18px auto 82px;
  padding: 0 24px;
  color: #667772;
  font-size: 12px;
  text-align: center;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #071d18;
  color: #fff;
  opacity: 1;
  transition: opacity 350ms ease;
}

.app-splash--leaving {
  opacity: 0;
  pointer-events: none;
}

.app-splash__content {
  width: min(100%, 420px);
  text-align: center;
  animation: splash-content-in 700ms cubic-bezier(.2,.8,.2,1) both;
}

.app-splash__brand {
  position: relative;
  overflow: hidden;
  margin: 0 auto 34px;
  border: 1px solid #34564d;
  background: #020806;
  box-shadow: 0 18px 50px rgb(0 0 0 / 35%);
}

.app-splash__content img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 0 auto;
  animation: splash-logo-in 1.2s cubic-bezier(.2,.8,.2,1) both;
}

.app-splash__scanner {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 2px;
  background: #ed3237;
  box-shadow: 0 0 16px #ed3237;
  animation: splash-scan 2.2s ease-in-out infinite alternate;
}

.app-splash__track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 4px;
  background: rgb(255 255 255 / 12%);
}

.app-splash__track span {
  display: block;
  width: 100%;
  height: 100%;
  background: #dc3434;
  transform: scaleX(0);
  transform-origin: left center;
  animation-name: inventory-loading;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  box-shadow: 0 0 12px #dc3434;
}

.app-splash__status {
  min-height: 20px;
  margin-top: 12px;
  color: #9ec7bb;
  font-size: 13px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-splash__status--visible {
  opacity: 1;
  transform: translateY(0);
}

.app-splash p {
  margin: 20px 0 8px;
  font-size: clamp(17px, 4.5vw, 21px);
  font-weight: 700;
  line-height: 1.35;
}

.app-splash small {
  color: #b9cbc5;
  font-size: 12px;
}

@keyframes inventory-loading {
  to { transform: scaleX(1); }
}

@keyframes splash-content-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splash-logo-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes splash-scan {
  from { transform: translateY(12px); opacity: .35; }
  to { transform: translateY(280px); opacity: 1; }
}

:root[data-theme="dark"] body {
  background: #0c1714 !important;
  color: #edf5f2 !important;
}

:root[data-theme="dark"] header,
:root[data-theme="dark"] main,
:root[data-theme="dark"] section,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .inventory-card,
:root[data-theme="dark"] .count-card,
:root[data-theme="dark"] form {
  color: #edf5f2;
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .inventory-card,
:root[data-theme="dark"] .count-card,
:root[data-theme="dark"] form,
:root[data-theme="dark"] main > div {
  background-color: #172420 !important;
  border-color: #354640 !important;
  box-shadow: none;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #0d1916 !important;
  border-color: #49615a !important;
  color: #f5faf8 !important;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] small {
  color: #aabbb5 !important;
}

:root[data-theme="dark"] .app-credits {
  color: #9eb1aa;
}

@media (prefers-reduced-motion: reduce) {
  .app-splash__track span { animation-timing-function: steps(10); }
}
.cyclic-requirement {
  align-self: center;
  margin: 4px 12px;
  padding: 7px 10px;
  border: 1px solid #d6a43b;
  border-radius: 6px;
  background: #fff4d8;
  color: #684b0b;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.cyclic-requirement--complete {
  border-color: #4b8f76;
  background: #dff1e9;
  color: #135b46;
}

:root[data-theme="dark"] .cyclic-requirement {
  border-color: #aa7c24;
  background: #302713;
  color: #f6d98e;
}

:root[data-theme="dark"] .cyclic-requirement--complete {
  border-color: #4b8f76;
  background: #123529;
  color: #a8e1cd;
}
.store-name {
  margin: 3px 0 0;
  color: #477066;
  font-size: 13px;
  font-weight: 700;
}

:root[data-theme="dark"] .store-name {
  color: #9ec7bb;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: #050505;
  padding: 4px;
}
