/* Base, layout and forms. Part of the site style sheet: the files load in number order and the order must not change. */
:root {
  --bg: #f4f6fa;
  --card: #fff;
  --ink: #1b2430;
  --muted: #667085;
  --line: #dfe4ec;
  --accent: #1f5fbf;
  --accent-ink: #fff;
  --ok: #17803d;
  --bad: #b42318;
  --warn: #a15c07;
  --r: 12px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  font:
    16px/1.45 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 64px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
h1 {
  font-size: 1.5rem;
  margin: 0.2em 0 0.6em;
}
h2 {
  font-size: 1.15rem;
  margin: 1em 0 0.5em;
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}
.logo img {
  display: block;
  height: 44px;
  width: auto;
}
.logo {
  font-weight: 700;
  color: var(--accent);
  margin-right: auto;
  font-size: 1.05rem;
}
.top .links {
  display: none;
  gap: 14px;
}
.top .links a {
  color: var(--ink);
}
.top .links a.on {
  color: var(--accent);
  font-weight: 600;
}
.pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  position: relative;
}
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--bad);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 1px 6px;
}
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 8px;
  z-index: 5;
}
.bottom a {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 4px 8px;
  text-align: center;
}
.bottom a.on {
  color: var(--accent);
  font-weight: 600;
}
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
}
.hero {
  background: linear-gradient(135deg, #1f5fbf, #3b82d6);
  color: #fff;
  border-radius: var(--r);
  padding: 24px 18px;
  margin-bottom: 16px;
}
.hero h1 {
  margin-top: 0;
}
.hero p {
  margin: 0 0 16px;
  opacity: 0.95;
}
.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn.sec {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.discard {
  background: #ffe28a;
  color: #5c3b00;
  border: 1px solid #d99a00;
}
.textbtn {
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  color: var(--muted, #667);
  text-decoration: underline;
  cursor: pointer;
}
.btn.danger {
  background: var(--bad);
}
.hero .btn {
  margin: 0 8px 8px 0;
}
.hero .btn.sec {
  border-color: #fff;
}
.btn[disabled] {
  opacity: 0.6;
}
.grid {
  display: grid;
  gap: 12px;
}
.steps {
  grid-template-columns: 1fr;
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 12px 0 4px;
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 9px 11px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: #0b2a5b;
  font-weight: 700;
}
input::placeholder,
textarea::placeholder {
  font-weight: 400;
  color: #98a2b3;
}
input[type='checkbox'],
input[type='radio'],
input[type='file'] {
  border: 0;
  font-weight: 400;
}
/* The field being filled in: green frame (owner 2026-10-03), instead of the browser's black outline. */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35);
}
input[type='checkbox']:focus-visible {
  outline: 3px solid #16a34a;
  outline-offset: 2px;
}
input[type='checkbox'] {
  width: auto;
  margin-right: 8px;
}
.check {
  display: flex;
  align-items: flex-start;
  font-weight: 400;
  margin: 10px 0;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.err {
  color: var(--bad);
  font-size: 0.85rem;
  margin-top: 4px;
}
.formerr {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: var(--bad);
  padding: 10px;
  border-radius: 10px;
  margin: 10px 0;
}
.okmsg {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: var(--ok);
  padding: 10px;
  border-radius: 10px;
  margin: 10px 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.filters label {
  margin-top: 0;
}
.lot {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  color: inherit;
}
.lot .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}
.lot b {
  font-size: 1.05rem;
}
.pic {
  --box: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--box);
  height: var(--box);
}
.pic img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(var(--box) * var(--s));
  max-height: calc(var(--box) * var(--s));
}
.pic.WET_BLUE {
  --s: 0.74;
}
.pic.SALTED_HIDES {
  --s: 0.81;
}
.pic.CRUST {
  --s: 0.75;
}
.pic.WET_BLUE_SPLIT {
  --s: 0.57;
}
.pic.big {
  --box: 200px;
  margin: 0 auto 8px;
}
.pic.mid {
  --box: 150px;
  margin: 8px auto;
}
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e8f0fc;
  color: var(--accent);
}
.tag.ACTIVE {
  background: #ecfdf3;
  color: var(--ok);
}
.tag.SOLD,
.tag.CLOSED {
  background: #eef0f3;
  color: var(--muted);
}
.tag.EXPIRED {
  background: #fff4e5;
  color: var(--warn);
}
dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 8px 0;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  font-weight: 500;
}
/* The comment: its own line under the other fields, label above the text, long text wraps. */
dt.wide,
dd.wide {
  grid-column: 1 / -1;
}
dt.wide {
  margin-top: 6px;
  margin-bottom: -4px;
}
dd.wide {
  font-style: italic;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.reveal {
  border: 2px dashed var(--accent);
  background: #f3f8ff;
}
.seller-name {
  color: var(--accent);
  font-weight: 700;
}
.supplier-btn.btn {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(31, 95, 191, 0.35);
  text-decoration: none;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
}
.kpi b {
  display: block;
  font-size: 1.6rem;
  color: var(--accent);
}
.bar {
  background: #e8f0fc;
  border-radius: 6px;
  height: 10px;
  margin: 3px 0 8px;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
}
#toasts {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 76px;
  display: grid;
  gap: 6px;
  z-index: 9;
}
.toast {
  background: #1b2430;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}
.toast.error {
  background: var(--bad);
}
@media (min-width: 760px) {
  body {
    padding-bottom: 0;
  }
  .bottom {
    display: none;
  }
  .top .links {
    display: flex;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .filters {
    grid-template-columns: repeat(4, 1fr);
  }
  .hero {
    padding: 40px 32px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .lot {
    grid-template-columns: 120px 1fr;
  }
  .pic {
    --box: 104px;
  }
  .kpis {
    grid-template-columns: repeat(4, 1fr);
  }
  .cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}
.prod {
  text-align: center;
}
.combo {
  position: relative;
}
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 2px 0 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.combo-list[hidden] {
  display: none;
}
.combo-list li {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.combo-list li:hover {
  background: #e8f0fc;
}
.req {
  color: #d92d20;
  font-weight: 700;
}
.consent {
  border: 2px solid var(--accent);
  background: #f3f8ff;
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 16px 0;
}
.consent.invalid {
  border-color: var(--bad);
  background: #fef3f2;
}
.consent-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.consent input[type='checkbox'] {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  flex: none;
  accent-color: var(--accent);
}
.consent .check {
  align-items: center;
  font-weight: 500;
}
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 6px 0 0;
}
.counter {
  font-weight: 700;
  color: var(--bad);
}
.counter.ok {
  color: var(--ok);
}
input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[readonly],
input:disabled,
textarea:disabled,
select:disabled {
  background: #e6e4e1;
  color: #555;
  border-color: #cfcbc6;
  cursor: not-allowed;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.chip input {
  width: auto;
  margin: 0;
}

/* Form fields are as wide as what goes into them (owner: about twice the longest value), not the whole screen. */
.formcard input[data-num] {
  width: 6.5ch;
  padding-inline: 8px;
}
/* Total area is a big number (for example 16000.50 m²): twice the width (owner 2026-10-15). */
.formcard #totalAreaValue {
  width: 13ch;
  padding-inline: 10px;
}
.formcard #quantity,
.formcard #totalWeightKg {
  width: 10ch;
  padding-inline: 10px;
}
.formcard #price {
  width: 8ch;
  padding-inline: 8px;
}
.formcard select {
  width: auto;
  min-width: 9ch;
  max-width: 100%;
}
.formcard #totalAreaUnit,
.formcard #averageAreaUnit,
.formcard #pieceAreaUnit,
.formcard #saleUnit {
  width: 6.5ch;
  min-width: 0;
  padding-inline: 6px;
}
.formcard #city,
.formcard #exactColor,
.formcard .combo {
  width: 100%;
  max-width: 32ch;
}
.formcard .row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.formcard textarea {
  max-width: 60ch;
}

.dealbox {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 4px;
  padding: 14px 16px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: #eaf1fc;
  font-weight: 600;
}
.dealbox strong {
  font-size: 1.6rem;
  color: var(--accent);
}

/* Hint above the form while no product is chosen: a small framed line, not a grey stray text. */
.pickhint {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 8px 16px;
  border: 1px dashed var(--line, #c9d1dc);
  border-radius: 8px;
  background: #f5f8fc;
  color: #3d5a80;
  font-weight: 600;
  font-size: 0.95rem;
}
