/* =====================================================================
   RQ Phones — estilo base (igual nos dois sites: vitrine e painel)
   ===================================================================== */
:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #EBEFF5;
  --line: #DCE2EC;
  --text: #1E2128;
  --muted: #5F6878;
  --accent: #6D87B0;
  --accent-strong: #4F6A93;
  --accent-soft: #E3EAF4;
  --on-accent: #FFFFFF;
  --ok: #1F9D63;
  --ok-soft: #DDF3E8;
  --danger: #C8423B;
  --danger-soft: #F8E1DF;
  --wa: #1FAF57;
  --shadow: 0 1px 2px rgba(30,33,40,.06), 0 6px 20px rgba(30,33,40,.06);
  --radius: 18px;
  --radius-sm: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  /* azul-marinho puxado do azul aço da logo (#6D87B0) */
  --bg: #0B1322;
  --surface: #121D31;
  --surface-2: #1A2740;
  --line: #24344F;
  --text: #EEF3FB;
  --muted: #9DAECA;
  --accent: #7E9BC8;
  --accent-strong: #B3C6E6;
  --accent-soft: #1E3050;
  --on-accent: #0B1322;
  --ok: #3CCB86;
  --ok-soft: #173326;
  --danger: #F07A73;
  --danger-soft: #3A1F1E;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-strong); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand img { height: 40px; width: 40px; border-radius: 11px; border: 1px solid var(--line); object-fit: cover; }
.brand .dot { color: var(--accent); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
}
.icon-btn svg { width: 20px; height: 20px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600;
  text-decoration: none; color: var(--text);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Chips / segmentos ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button {
  min-height: 46px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; color: var(--muted);
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Selos de condição ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.badge-Lacrado { background: var(--accent-soft); color: var(--accent-strong); }
.badge-Semi { background: #FBEFD9; color: #8A5A0B; }
[data-theme="dark"] .badge-Semi { background: #3A2F1A; color: #F1C46B; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none;
}
textarea.input { min-height: 140px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 42px; background: var(--surface); }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.thumb {
  width: 64px; height: 64px; flex: none; border-radius: 14px;
  background: var(--surface-2); display: grid; place-items: center; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb svg { width: 28px; height: 28px; color: var(--muted); }
.thumb svg.art { width: 100%; height: 100%; }
.thumb img.official { object-fit: contain; padding: 6%; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--accent); display: block; }

/* ---------- Aviso rápido (toast) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; translate: -50% 0; z-index: 100;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px);
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; translate: -50% 8px; } }
