:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4ee;
  color: #163432;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(234, 181, 83, 0.22), transparent 42%),
    #f3f4ee;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.topbar,
.section-heading,
.search-row,
.session-bar,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
.result-caption {
  margin: 0 0 6px;
  color: #b46428;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 8vw, 3rem);
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 8px;
}

.icon-button,
.text-button {
  border: 0;
  background: transparent;
  color: #275957;
  cursor: pointer;
}

.icon-button {
  min-width: 44px;
  height: 44px;
  font-size: 0.9rem;
  font-weight: 900;
}

.session-bar {
  margin: -12px 0 16px;
  color: #55706f;
  font-size: 0.82rem;
  font-weight: 800;
}

.search-card,
.search-results,
.scanner-card,
.result-card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(22, 52, 50, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(22, 52, 50, 0.08);
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: rgba(22, 52, 50, 0.1);
}

.search-results {
  margin-bottom: 16px;
  padding: 18px;
}

.product-list {
  display: grid;
  gap: 8px;
}

.results-heading {
  align-items: flex-start;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  color: #55706f;
  font-size: 0.76rem;
  font-weight: 900;
}

.sort-select {
  width: auto;
  min-width: 92px;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.load-more-button {
  width: 100%;
  margin-top: 12px;
}

.load-more-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.product-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(22, 63, 61, 0.12);
  border-radius: 12px;
  background: #f4f7f2;
}

.product-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #163432;
  cursor: pointer;
  text-align: left;
}

.product-option span {
  color: #6c7d7b;
  font-size: 0.78rem;
}

.product-option .result-stock {
  color: #b46428;
  font-weight: 900;
}

.product-option .result-price {
  color: #163f3d;
  font-weight: 900;
}

.product-option .result-cost {
  color: #7c3f20;
  font-weight: 900;
}

.product-option .result-sales-age {
  color: #55706f;
  font-weight: 900;
}

.meli-link {
  justify-self: start;
  color: #0b5cad;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.meli-link:focus,
.meli-link:hover {
  text-decoration: underline;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  margin-bottom: 18px;
  padding: 17px;
  background: #163f3d;
  color: white;
  font-size: 1.08rem;
}

.secondary-button {
  padding: 13px 16px;
  background: #eab553;
  color: #382610;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #55706f;
  font-size: 0.83rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  padding: 13px;
  border: 1px solid #c7d0ca;
  border-radius: 12px;
  background: white;
  color: #163432;
}

select {
  width: 100%;
  min-width: 0;
  padding: 13px;
  border: 1px solid #c7d0ca;
  border-radius: 12px;
  background: white;
  color: #163432;
  font: inherit;
}

.search-row input {
  flex: 1;
}

.result-card {
  min-height: 205px;
  padding: 22px;
}

.result-card h2 {
  font-size: 1.6rem;
  line-height: 1.12;
}

.price {
  margin: 3px 0 0;
  color: #163f3d;
  font-size: clamp(2.25rem, 11vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.prices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.price-row {
  padding: 14px;
  border-radius: 14px;
  background: #f4f7f2;
}

.price-list {
  margin-bottom: 0;
  color: #b46428;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(22, 63, 61, 0.14);
  border-radius: 14px;
}

.stock-label,
.stock-value {
  margin: 0;
  font-weight: 900;
}

.stock-label {
  color: #55706f;
  text-transform: uppercase;
}

.stock-value {
  color: #163f3d;
  font-size: 1.8rem;
}

.stock-alert-button {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 75, 40, 0.28);
  border-radius: 13px;
  background: #fff8f3;
  color: #9d3f1e;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-alert-button:focus,
.stock-alert-button:hover {
  background: #ffeede;
}

.sales-age-row {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 63, 61, 0.12);
  border-radius: 14px;
  background: #f4f7f2;
}

.sales-age-label,
.sales-age-value {
  margin: 0;
  font-weight: 900;
}

.sales-age-label {
  color: #55706f;
  text-transform: uppercase;
}

.sales-age-value {
  color: #163f3d;
}

.muted {
  color: #6c7d7b;
}

.error {
  border-color: rgba(180, 75, 40, 0.28);
  background: #fff8f3;
}

.hidden {
  display: none;
}

#reader {
  overflow: hidden;
  border-radius: 14px;
}

dialog {
  width: min(calc(100% - 36px), 420px);
  padding: 20px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(22, 52, 50, 0.28);
}

dialog::backdrop {
  background: rgba(16, 47, 45, 0.48);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

#admin-dialog {
  width: min(calc(100% - 24px), 560px);
}

.admin-users {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.security-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}

.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 63, 61, 0.12);
  border-radius: 12px;
  background: #f4f7f2;
}

.security-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 63, 61, 0.12);
  border-radius: 12px;
  background: #f4f7f2;
}

.security-item.compact {
  padding: 10px 12px;
}

.security-item div {
  display: grid;
  gap: 3px;
}

.security-item span {
  color: #6c7d7b;
  font-size: 0.78rem;
}

.admin-user div:first-child {
  display: grid;
  gap: 3px;
}

.admin-user span {
  color: #6c7d7b;
  font-size: 0.82rem;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.danger-button {
  color: #a63d25;
}

h3 {
  margin: 0 0 12px;
}

h4 {
  margin: 12px 0 6px;
  color: #55706f;
  font-size: 0.86rem;
  text-transform: uppercase;
}
