/* Handheld Hub — visual neutro e minimalista. Cor só nos acentos de cada console. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111113;
  --muted: #6b6b73;
  --faint: #a1a1aa;
  --line: #e7e7ea;
  --hover: #f4f4f5;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0d; --surface: #141416; --text: #ededef; --muted: #9b9ba3; --faint: #5f5f66;
    --line: #26262a; --hover: #1b1b1e; --danger: #f87171; --ok: #4ade80; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0d; --surface: #141416; --text: #ededef; --muted: #9b9ba3; --faint: #5f5f66;
  --line: #26262a; --hover: #1b1b1e; --danger: #f87171; --ok: #4ade80; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- topo ---------- */
.top { border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 56px; }
.brand { font-weight: 650; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); white-space: nowrap; font-size: 14px; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: var(--hover); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--hover); }

main { padding: 40px 0 72px; }
.view { display: flex; flex-direction: column; gap: 40px; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.lead { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- números ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat { padding: 18px 20px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.bad b { color: var(--danger); }

/* ---------- consoles ---------- */
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.device {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s;
}
.device:hover { border-color: var(--faint); }
.device-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--faint)); flex: none; }
.device p { color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { text-align: right; }
.device .more { margin-top: auto; font-size: 13px; color: var(--muted); }
.device:hover .more { color: var(--text); }

.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: var(--accent, var(--text)); }
.store-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.store-row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

/* ---------- detalhe ---------- */
.back { font-size: 14px; color: var(--muted); }
.back:hover { color: var(--text); }
.detail-head { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.detail-head .dot { width: 12px; height: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel .kv { gap: 10px 16px; }
.panel .store + .store { margin-top: 14px; }
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 28px 40px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.source { font-size: 13px; color: var(--faint); }

/* ---------- jogos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; outline: none;
}
.filters input { flex: 1 1 280px; }
.filters input:focus, .filters select:focus { border-color: var(--faint); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:first-child { padding-left: 0; } .table th:first-child { padding-left: 0; }
.table .sys { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.copies { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.copies span { display: inline-flex; align-items: center; gap: 6px; }
.copies .bad { color: var(--danger); }
.btn { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--faint); }

/* ---------- saúde ---------- */
.list { list-style: none; font-size: 14px; max-height: 480px; overflow-y: auto; }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li span:last-child { color: var(--muted); white-space: nowrap; font-size: 13px; }

footer { border-top: 1px solid var(--line); padding: 20px 0; font-size: 13px; color: var(--faint); }

@media (max-width: 720px) {
  main { padding-top: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
  .top .wrap { gap: 8px; }
  .brand { display: none; }
  .nav a { padding: 6px 8px; }
}

/* ---------- ícones (Lucide, grade 24) e logos (Simple Icons) ----------
   Traço sempre 1,5 px na tela (3 px no Retina): stroke-width = 1.5 × 24 / tamanho. */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; stroke-width: 2.25; }
.logo { height: 18px; width: 18px; flex: none; fill: currentColor; }
.logo.wide { width: 60px; height: 12px; }
.device-name .logo, .device-name .ic { color: var(--muted); }
.device-name .logo.wide { margin-left: auto; }
.detail-head .logo, .detail-head .ic { color: var(--muted); }
.stat span { display: inline-flex; align-items: center; gap: 6px; }
.stat.bad span { color: var(--danger); }
h2 { display: flex; align-items: center; gap: 8px; }
h2 .ic { color: var(--faint); }
.store-row span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.store-row .ic { color: var(--faint); }
.back, .device .more { display: inline-flex; align-items: center; gap: 4px; }
.search { position: relative; flex: 1 1 280px; display: flex; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.filters .search input { flex: 1; padding-left: 36px; }
