/* Fonte unica de cores, tipografia e pecas da loja e do painel. Nunca cor fora destes tokens. */

:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --ink: #131a22;
  --muted: #5b6671;
  --line: #dde1dc;
  --field: #c9cfc8;
  --tape: #ffc22e;
  --on-tape: #2b2000;
  --wa: #12803d;
  --on-wa: #ffffff;
  --danger: #b3261e;
  --ok-bg: #e4f2e8;
  --ok: #0f5f2c;
  --reserved-bg: #e3eaf1;
  --reserved: #2f4a63;
  --off: #6b7580;
  --ph1: #e6e8e2;
  --ph2: #dde0d9;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
}

h1, h2, h3, p, dl, dd { margin: 0; }

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

a { color: inherit; }

:focus-visible { outline: 3px solid var(--reserved); outline-offset: 2px; }

[hidden] { display: none !important; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }

/* ---------- etiquetas ---------- */

.eyebrow {
  display: inline-block; background: var(--tape); color: var(--on-tape);
  font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px;
}

.code {
  position: absolute; left: 0; top: 12px; background: var(--tape); color: var(--on-tape);
  font-weight: 700; font-size: 13px; padding: 3px 10px 3px 8px; font-variant-numeric: tabular-nums;
}

.tag { font-size: 13px; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; }
.tag.dl { background: var(--tape); border-color: var(--tape); color: var(--on-tape); font-weight: 700; }

.pill { display: inline-block; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 99px; }
.pill.available { background: var(--ok-bg); color: var(--ok); }
.pill.reserved { background: var(--reserved-bg); color: var(--reserved); }
.pill.sold { background: var(--ink); color: var(--surface); }
.pill.expired { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

/* ---------- botoes e campos ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; text-decoration: none; text-align: center; cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.wa { background: var(--wa); color: var(--on-wa); border-color: var(--wa); }
.btn.outline { border-color: var(--ink); }
.btn.dark { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.off { background: #e9ece8; color: var(--muted); border-color: #e9ece8; cursor: default; }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .label, legend { font-weight: 500; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }

input[type="text"], input[type="search"], input[type="date"], input[type="email"], textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--field);
  border-radius: 6px; background: var(--surface);
}
textarea { min-height: 96px; resize: vertical; }

/* select e campo de texto com a mesma altura e a mesma seta, em qualquer navegador */
.select { position: relative; display: flex; align-items: center; }
.select select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 46px; margin: 0;
  padding: 0 40px 0 14px; border: 1px solid var(--field); border-radius: 6px;
  background: var(--surface); line-height: 1.2;
}
.select::after {
  content: ""; position: absolute; right: 16px; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-3px) rotate(45deg);
}

.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }

fieldset { margin: 0; min-width: 0; border: 1px solid var(--field); border-radius: 6px; padding: 8px 14px 14px; background: var(--surface); display: grid; gap: 8px; }
legend { padding: 0 4px; }

.switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
  border: 0; background: transparent; cursor: pointer; font-weight: 500;
}
.switch .track { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--off); flex: none; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
}
.switch[aria-checked="true"] .track { background: var(--ink); }
.switch[aria-checked="true"] .track::after { left: 21px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 6px; z-index: 90;
  max-width: calc(100% - 32px); font-size: 14px;
}
.toast.is-error { background: var(--danger); }

.empty { padding: 56px 0; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty h2 { font: 700 24px var(--display); color: var(--ink); }
.empty p { max-width: 34ch; }

.loading { padding: 56px 0; text-align: center; color: var(--muted); }

.ph {
  display: grid; place-items: center; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  background: repeating-linear-gradient(135deg, var(--ph1) 0 14px, var(--ph2) 14px 28px);
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
