/* Lívia Gomes IA — design system
   Carvão + lima neon. Cards arredondados, muito respiro, tipografia Inter. */

:root {
  --bg: #0e0f11;
  --bg-2: #131417;
  --surface: #17181c;
  --surface-2: #1d1f24;
  --surface-3: #24272d;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f3f1;
  --text-2: #b9bbc2;
  --muted: #8a8d96;
  --accent: #ff4d8d;
  --accent-2: #ff7ab0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 77, 141, 0.16);
  --accent-glow: 0 0 0 4px rgba(255, 77, 141, 0.18), 0 10px 34px rgba(255, 77, 141, 0.42);
  --wine: #7a1734;
  --wine-deep: #4a0d21;
  --blush: #f3e7ea;
  --sand: #e4dac6;
  --sage: #d6ff5c;
  --sage-ink: #1f2a05;
  --pink: #ff4d8d;
  --violet: #ff9ac4;
  --warn: #e4b36a;
  --danger: #ff7b7b;
  --ok: #d6ff5c;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --sidebar: 256px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3e7ea;
  --bg-2: #f8f0f2;
  --surface: #ffffff;
  --surface-2: #f7eff1;
  --surface-3: #eee0e4;
  --border: rgba(122, 23, 52, 0.08);
  --border-strong: rgba(122, 23, 52, 0.16);
  --text: #2a0f18;
  --text-2: #4e3038;
  --muted: #8b6f77;
  --accent: #e9226f;
  --accent-2: #ff5c9a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(233, 34, 111, 0.10);
  --accent-glow: 0 0 0 4px rgba(233, 34, 111, 0.14), 0 8px 24px rgba(233, 34, 111, 0.25);
  --ok: #5d8a00;
  --sage-ink: #1f2a05;
  --sage: #c6f542;
  --shadow: 0 14px 40px rgba(20, 20, 22, 0.08);
  --shadow-sm: 0 4px 14px rgba(20, 20, 22, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-image: radial-gradient(900px 500px at 0% 0%, rgba(255, 77, 141, 0.10), transparent 60%), radial-gradient(700px 400px at 100% 100%, rgba(214, 255, 92, 0.05), transparent 60%);
  background-attachment: fixed;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.right { text-align: right; }
.center { text-align: center; }
.accent { color: var(--accent); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 20px; }
.flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

/* ------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 18px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--wine)); color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 22px rgba(255, 77, 141, 0.45);
}
.brand b { font-size: 15.5px; font-weight: 700; display: block; }
.brand span { font-size: 11.5px; color: var(--muted); }
.nav-label { font-size: 10.5px; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; padding: 14px 12px 6px; text-transform: uppercase; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--accent); box-shadow: 0 0 18px var(--accent);
}
.nav a .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); font-size: 14px; flex: none; }
.nav a.active .ic { background: var(--accent-soft); color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; }
.sidebar .foot { margin-top: auto; padding: 10px 12px; font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px 32px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.topbar .title { font-size: 15px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center;
  cursor: pointer; position: relative; color: var(--text-2);
}
.iconbtn:hover { border-color: var(--border-strong); color: var(--text); }
.iconbtn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 10px var(--sage); }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--wine)); display: grid; place-items: center; font-weight: 700; color: #fff; }
.content { padding: 28px 32px 60px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 14px; }

/* -------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-sm);
}
.card.pad-sm { padding: 16px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 15.5px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card.accent-card { background: linear-gradient(140deg, #ff5f9c 0%, #f23b80 45%, #b3175a 100%); color: #fff; border: none; box-shadow: 0 16px 44px rgba(255, 77, 141, 0.35); }
.card.accent-card .muted { color: rgba(255, 255, 255, 0.72); }
.card.accent-card .accent { color: #fff; }
.card.dark-card { background: linear-gradient(160deg, #2a0b17, #17070e); border-color: rgba(218, 132, 155, 0.18); color: var(--blush); }
.card.dark-card .muted { color: rgba(243, 231, 234, 0.6); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .delta { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.kpi .delta.up { background: rgba(214, 255, 92, 0.16); color: var(--ok); }
.kpi .delta.down { background: rgba(255, 123, 123, 0.14); color: var(--danger); }
.kpi .icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-size: 14px; }
.accent-card .kpi .icon { background: rgba(255, 255, 255, 0.18); }
.accent-card .kpi .delta, .accent-card .kpi .delta.up, .accent-card .kpi .delta.down { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(255, 77, 141, 0.28); }
.btn.primary:hover { box-shadow: var(--accent-glow); }
.btn.dark { background: #0b0c0e; color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(255, 97, 97, 0.12); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.xs { padding: 4px 10px; font-size: 11.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------- pills */
.pills { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; flex-wrap: wrap; }
.pills a, .pills button { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); border: none; background: transparent; cursor: pointer; }
.pills a:hover, .pills button:hover { color: var(--text); }
.pills a.active, .pills button.active { background: var(--text); color: var(--bg); font-weight: 600; }
:root[data-theme="light"] .pills a.active, :root[data-theme="light"] .pills button.active { background: #141416; color: #fff; }
.pills a.active.lime, .pills button.active.lime { background: var(--accent); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.chip input { display: none; }

/* -------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.lime { background: var(--sage); color: var(--sage-ink); border-color: transparent; }
.badge.ok { background: rgba(214, 255, 92, 0.16); color: var(--ok); border-color: transparent; }
.badge.warn { background: rgba(255, 181, 71, 0.14); color: var(--warn); border-color: transparent; }
.badge.danger { background: rgba(255, 97, 97, 0.14); color: var(--danger); border-color: transparent; }
.badge.pink { background: rgba(255, 77, 141, 0.18); color: #ff8ab9; border-color: transparent; }
.badge.violet { background: rgba(255, 77, 141, 0.14); color: var(--violet); border-color: transparent; }
.store-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex: none; }
.score.hot { background: var(--sage); color: var(--sage-ink); box-shadow: 0 0 14px rgba(214, 255, 92, 0.35); }
.score.good { background: var(--sage); color: var(--sage-ink); }
.score.mid { background: rgba(255, 181, 71, 0.16); color: var(--warn); }
.score.low { background: var(--surface-2); color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-dot.connected { background: var(--sage); box-shadow: 0 0 10px var(--sage); }
.status-dot.error { background: var(--danger); }
.status-dot.waiting_approval { background: var(--warn); }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(214, 255, 92, .6); } 70% { box-shadow: 0 0 0 8px rgba(214, 255, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(214, 255, 92, 0); } }

/* -------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { padding: 8px 12px; font-size: 13px; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search .input { padding-left: 40px; }
.search::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 500; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* -------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table th:first-child { border-radius: 12px 0 0 12px; }
.table th:last-child { border-radius: 0 12px 12px 0; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.thumb.lg { width: 64px; height: 64px; border-radius: 14px; }

/* ------------------------------------------------------- product cards */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; position: relative; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pcard .img { aspect-ratio: 1; background: var(--surface-2); position: relative; overflow: hidden; }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; }
.pcard .img .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; opacity: .3; }
.pcard .store-tag { position: absolute; top: 10px; left: 10px; font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); backdrop-filter: blur(6px); }
.pcard .fav { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; font-size: 15px; display: grid; place-items: center; backdrop-filter: blur(6px); }
.pcard .fav.on { color: var(--pink); }
.pcard .sel { position: absolute; top: 10px; left: 10px; z-index: 2; }
.pcard .sel .check { width: 20px; height: 20px; border-radius: 6px; }
.pcard .store-tag.shift { left: 38px; }
.pcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .title { font-size: 13px; font-weight: 600; line-height: 1.35; min-height: 35px; }
.pcard .price { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.pcard .price s { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.pcard .comm { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); }
.pcard .comm b { color: var(--accent); font-size: 15px; }
:root[data-theme="light"] .pcard .comm b { color: var(--wine); }
.pcard .comm { background: rgba(214, 255, 92, 0.12); }
.pcard .comm b { color: var(--sage) !important; }
:root[data-theme="light"] .pcard .comm { background: rgba(122, 23, 52, 0.07); }
.pcard .comm span { font-size: 11px; color: var(--muted); }
.pcard .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.pcard .rank { position: absolute; top: 10px; right: 48px; background: var(--sage); color: var(--sage-ink); font-weight: 800; font-size: 11px; padding: 3px 8px; border-radius: 999px; }

/* -------------------------------------------------------- misc blocks */
.wa-bubble { background: #1f2c34; color: #e9edef; border-radius: 12px 12px 12px 2px; padding: 12px 14px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; max-width: 420px; position: relative; font-family: "Segoe UI", Helvetica, sans-serif; }
.wa-wrap { background: #0b141a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1' fill='%23ffffff10'/%3E%3C/svg%3E"); padding: 18px; border-radius: 16px; }
.wa-bubble .time { display: block; text-align: right; font-size: 10.5px; color: #8696a0; margin-top: 4px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.progress > i.warn { background: var(--warn); }
.progress > i.danger { background: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--text); min-height: 3px; transition: height .3s; }
.bars .b i.lime { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.bars .b span { font-size: 10.5px; color: var(--muted); }
.bars .b .stack { width: 100%; max-width: 34px; display: flex; flex-direction: column; gap: 3px; justify-content: flex-end; height: 100%; }
.list { display: flex; flex-direction: column; }
.list .row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list .row:last-child { border-bottom: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.empty b { color: var(--text); display: block; margin-bottom: 4px; }
.flash { position: fixed; right: 28px; bottom: 28px; z-index: 100; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); max-width: 440px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: rise .25s ease-out; }
.flash.ok { border-left: 4px solid var(--sage); }
.flash.warn { border-left: 4px solid var(--warn); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
details.acc summary { cursor: pointer; list-style: none; font-weight: 600; display: flex; align-items: center; gap: 8px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 18px; }
details.acc[open] summary::after { content: "–"; }
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
.copyable { cursor: copy; }
.tooltip { position: relative; }
.phone { width: 300px; border-radius: 36px; border: 8px solid #0b0c0e; background: #0b0c0e; overflow: hidden; box-shadow: var(--shadow); }
.phone .scr { height: 560px; overflow-y: auto; background: #fff; color: #111; }
.sparkline { width: 100%; height: 60px; }
.donut { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.donut b { position: relative; z-index: 1; font-size: 15px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 200; padding: 20px; }
.modal.open { display: grid; }
.modal .box { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); padding: 24px; width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.toast-copy { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; z-index: 300; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.sticky-actions { position: sticky; bottom: 16px; z-index: 30; display: none; margin-top: 16px; }
.sticky-actions.show { display: block; }
.sticky-actions .card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #0b0c0e; color: #fff; border-color: rgba(255,255,255,.1); }
.sticky-actions .input { background: #17181c; color: #fff; border-color: rgba(255,255,255,.14); }

/* ------------------------------------------------------ responsivo */
@media (max-width: 1180px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2, .span-3 { grid-column: span 2; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; width: var(--sidebar); }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 12px 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .menu-toggle { display: grid !important; }
  .flash { left: 16px; right: 16px; bottom: 16px; }
}
.menu-toggle { display: none; }

.accent-card .kpi .label { color: rgba(255, 255, 255, 0.95); font-weight: 600; }
.accent-card .btn { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; }

/* ============================================================ motion
   Tudo em transform/opacity. Curvas "cinematográficas": saída rápida,
   assentamento suave. Desligado para quem pede menos movimento. */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 720ms;
}
html.js .reveal { opacity: 0; transform: translateY(18px) scale(0.985); filter: blur(6px); will-change: transform, opacity, filter; }
html.js .reveal.in { opacity: 1; transform: none; filter: blur(0); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), filter var(--dur) var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
html.js .reveal.in.done { will-change: auto; filter: none; }

/* cabeçalho da página */
html.js .page-head h1, html.js .page-head p, html.js .page-head .btn-row, html.js .page-head .pills { opacity: 0; transform: translateY(14px); animation: head-in 900ms var(--ease-out) forwards; }
html.js .page-head p { animation-delay: 90ms; }
html.js .page-head .btn-row, html.js .page-head .pills { animation-delay: 180ms; }
@keyframes head-in { to { opacity: 1; transform: none; } }

/* topbar e sidebar */
html.js .topbar { animation: fade-down 600ms var(--ease-out) both; }
@keyframes fade-down { from { opacity: 0; transform: translateY(-10px); } }
.topbar { transition: box-shadow .3s, background .3s; }
.topbar.scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
html.js .sidebar .nav a { opacity: 0; transform: translateX(-10px); animation: nav-in 520ms var(--ease-out) forwards; animation-delay: calc(var(--n, 0) * 35ms + 120ms); }
@keyframes nav-in { to { opacity: 1; transform: none; } }
.nav a { transition: background .2s var(--ease-out), color .2s, transform .2s var(--ease-out); }
.nav a:hover { transform: translateX(3px); }
.nav a .ic { transition: transform .35s var(--ease-spring), background .2s; }
.nav a:hover .ic { transform: scale(1.08) rotate(-4deg); }
.nav a.active::before { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 14px var(--accent); } 50% { box-shadow: 0 0 26px var(--accent), 0 0 4px var(--accent); } }
.brand .logo { transition: transform .5s var(--ease-spring), box-shadow .3s; }
.brand:hover .logo { transform: rotate(-6deg) scale(1.06); box-shadow: 0 10px 30px rgba(255, 77, 141, 0.55); }

/* cards e botões */
.card { transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .3s; }
.card:hover { border-color: var(--border-strong); }
.grid > .card:hover, .kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card.accent-card { position: relative; overflow: hidden; }
.card.accent-card::after { content: ""; position: absolute; inset: -40%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.28), transparent 70%); transform: translate(-30%, -30%); animation: drift 9s ease-in-out infinite alternate; pointer-events: none; }
@keyframes drift { to { transform: translate(35%, 25%); } }
.btn { transition: transform .25s var(--ease-out), box-shadow .3s var(--ease-out), background .25s, border-color .25s, filter .25s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); transition-duration: .08s; }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-18deg); transition: left .8s var(--ease-out); }
.btn.primary:hover::after { left: 130%; }
.btn.primary:hover { filter: saturate(1.1) brightness(1.05); box-shadow: var(--accent-glow); }
.iconbtn { transition: transform .3s var(--ease-spring), border-color .2s, color .2s; }
.iconbtn:hover { transform: translateY(-2px) scale(1.04); }
.iconbtn .dot { animation: pulse 1.8s infinite; }
.chip, .pills a, .pills button { transition: background .25s var(--ease-out), color .2s, transform .2s var(--ease-out), border-color .2s; }
.chip:hover { transform: translateY(-1px); }
.chip.active { animation: chip-pop .35s var(--ease-spring); }
@keyframes chip-pop { 0% { transform: scale(0.94); } 100% { transform: scale(1); } }
.badge.lime, .score.hot { animation: shine 3.4s ease-in-out infinite; }
@keyframes shine { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }

/* produtos */
.pcard { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .3s; }
.pcard .img img { transition: transform 1.1s var(--ease-out), filter .6s; }
.pcard:hover .img img { transform: scale(1.06); }
.pcard:hover { transform: translateY(-4px); }
.pcard .comm { transition: background .3s, transform .3s var(--ease-out); }
.pcard:hover .comm { background: rgba(214, 255, 92, 0.2); transform: translateX(2px); }
.pcard .fav { transition: transform .35s var(--ease-spring), background .2s; }
.pcard .fav:hover { transform: scale(1.15); }
.pcard .fav.on { animation: heart .5s var(--ease-spring); }
@keyframes heart { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.pcard .rank { animation: rank-in .6s var(--ease-spring) both; animation-delay: .5s; }
@keyframes rank-in { from { transform: scale(0) rotate(-20deg); opacity: 0; } }

/* gráficos e progresso */
html.js .reveal .progress > i { transform: scaleX(0); transform-origin: left; }
html.js .reveal.in .progress > i { animation: grow-x 1.1s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 70ms + 200ms); }
@keyframes grow-x { to { transform: scaleX(1); } }
html.js .reveal .bars .b i { transform: scaleY(0); transform-origin: bottom; }
html.js .reveal.in .bars .b i { animation: grow-y .9s var(--ease-out) forwards; }
html.js .reveal.in .bars .b:nth-child(1) i { animation-delay: .10s } html.js .reveal.in .bars .b:nth-child(2) i { animation-delay: .16s } html.js .reveal.in .bars .b:nth-child(3) i { animation-delay: .22s } html.js .reveal.in .bars .b:nth-child(4) i { animation-delay: .28s } html.js .reveal.in .bars .b:nth-child(5) i { animation-delay: .34s } html.js .reveal.in .bars .b:nth-child(6) i { animation-delay: .40s } html.js .reveal.in .bars .b:nth-child(7) i { animation-delay: .46s } html.js .reveal.in .bars .b:nth-child(n+8) i { animation-delay: .52s }
@keyframes grow-y { to { transform: scaleY(1); } }
.bars .b i { transition: filter .25s, transform .25s; }
.bars .b:hover i { filter: brightness(1.2); }
html.js .reveal .sparkline polyline { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
html.js .reveal.in .sparkline polyline { animation: draw 1.6s var(--ease-out) forwards .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.kpi .value { font-variant-numeric: tabular-nums; }
.kpi .delta { opacity: 0; transform: translateY(6px); animation: head-in .6s var(--ease-out) forwards .9s; }
html:not(.js) .kpi .delta { opacity: 1; transform: none; }

/* listas e tabelas */
html.js .reveal.in .list .row, html.js .reveal.in .table tbody tr { animation: row-in .55s var(--ease-out) both; }
html.js .reveal.in .list .row:nth-child(1), html.js .reveal.in .table tbody tr:nth-child(1) { animation-delay: .15s } html.js .reveal.in .list .row:nth-child(2), html.js .reveal.in .table tbody tr:nth-child(2) { animation-delay: .21s } html.js .reveal.in .list .row:nth-child(3), html.js .reveal.in .table tbody tr:nth-child(3) { animation-delay: .27s } html.js .reveal.in .list .row:nth-child(4), html.js .reveal.in .table tbody tr:nth-child(4) { animation-delay: .33s } html.js .reveal.in .list .row:nth-child(5), html.js .reveal.in .table tbody tr:nth-child(5) { animation-delay: .39s } html.js .reveal.in .list .row:nth-child(n+6), html.js .reveal.in .table tbody tr:nth-child(n+6) { animation-delay: .45s }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } }
.list .row, .table tr { transition: background .2s; }
.list a.row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 10px; }

/* modal, flash, formulários */
.modal { transition: opacity .3s var(--ease-out); opacity: 0; }
.modal.open { opacity: 1; }
.modal .box { transform: translateY(20px) scale(0.97); opacity: 0; transition: transform .45s var(--ease-spring), opacity .3s; }
.modal.open .box { transform: none; opacity: 1; }
.flash { animation: flash-in .55s var(--ease-spring); }
@keyframes flash-in { from { transform: translateY(20px) scale(0.96); opacity: 0; } }
.input { transition: border-color .25s, box-shadow .3s var(--ease-out), background .2s, transform .2s; }
.input:focus { transform: translateY(-1px); }
.switch .track, .switch .track::after { transition: background .3s var(--ease-out), transform .35s var(--ease-spring); }
details.acc summary::after { transition: transform .3s var(--ease-spring); }
details.acc[open] summary::after { transform: rotate(180deg); }
.wa-bubble { animation: bubble .5s var(--ease-spring) both; transform-origin: bottom left; }
@keyframes bubble { from { transform: scale(0.94) translateY(6px); opacity: 0; } }
.tabs a { position: relative; transition: color .2s; }
.tabs a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .35s var(--ease-out); transform-origin: left; }
.tabs a.active::after { transform: scaleX(1); }
.tabs a.active { border-color: transparent; }
.sticky-actions.show .card { animation: flash-in .5s var(--ease-spring); }
.status-dot.connected { animation: pulse 2s infinite; }
.phone { transition: transform .6s var(--ease-out); }
.phone:hover { transform: translateY(-4px) rotate(-0.5deg); }

/* skeleton para imagens carregando */
.pcard .img { background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-3) 50%, var(--surface-2) 60%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; }
.pcard .img.loaded { animation: none; background: var(--surface-2); }
@keyframes shimmer { to { background-position: -120% 0; } }
.pcard .img img { opacity: 0; transition: opacity .6s var(--ease-out), transform 1.1s var(--ease-out); }
.pcard .img.loaded img { opacity: 1; }

/* transição de página */
html.js body { animation: page-in .5s var(--ease-out); }
@keyframes page-in { from { opacity: 0; } }
body.leaving .content { opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal, html.js .page-head h1, html.js .page-head p, html.js .page-head .btn-row, html.js .sidebar .nav a, .kpi .delta { opacity: 1 !important; transform: none !important; filter: none !important; }
  html.js .reveal .progress > i, html.js .reveal .bars .b i { transform: none !important; }
  .pcard .img img { opacity: 1 !important; }
}


/* ------------------------------------------------------ conexões */
.conn-grid { align-items: start; }
.conn-card { padding: 0; overflow: hidden; }
.conn-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 16px; }
.conn-head h3 { font-size: 17px; }
.conn-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; flex: none; box-shadow: var(--shadow-sm); }
.conn-caps { justify-content: flex-end; max-width: 180px; }
.conn-msg { margin: 0 22px 14px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.conn-msg.ok { background: rgba(214, 255, 92, 0.12); color: var(--ok); }
.conn-msg.warn { background: rgba(228, 179, 106, 0.14); color: var(--warn); }
:root[data-theme="light"] .conn-msg.ok { background: rgba(93, 138, 0, 0.10); color: #4d7300; }
:root[data-theme="light"] .conn-msg.warn { background: rgba(190, 120, 20, 0.12); color: #8a5a10; }
.conn-form { padding: 6px 22px 18px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--border); }
.conn-form .field .help { line-height: 1.4; }
.conn-quick { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--accent-soft); border: 1px dashed rgba(255, 77, 141, 0.45); }
.conn-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.conn-divider::before, .conn-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.conn-adv { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.conn-adv summary { font-weight: 600; font-size: 13px; }
.conn-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.conn-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--border); }
.conn-foot > details { padding: 14px 22px; }
.conn-foot > details + details { border-left: 1px solid var(--border); }
@media (max-width: 900px) { .conn-foot { grid-template-columns: 1fr; } .conn-foot > details + details { border-left: none; border-top: 1px solid var(--border); } .conn-caps { max-width: none; justify-content: flex-start; } }


/* ------------------------------------------------------ logos de loja */
.store-logo { width: 18px; height: 18px; border-radius: 5px; object-fit: contain; background: #fff; vertical-align: -4px; flex: none; }
.pcard .store-tag.has-logo { padding: 0; width: 34px; height: 34px; border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); display: grid; place-items: center; overflow: hidden; }
.pcard .store-tag.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.pcard .store-tag.has-logo.shift { left: 44px; }
.chip .store-logo { width: 16px; height: 16px; border-radius: 4px; }
.conn-logo.has-logo { background: #fff !important; padding: 6px; }
.conn-logo.has-logo img { width: 100%; height: 100%; object-fit: contain; }


/* ------------------------------------------------- barra de ações */
.btn.lg { padding: 14px 24px; font-size: 15px; font-weight: 700; }
.btn.primary.lg { box-shadow: 0 10px 28px rgba(255, 77, 141, 0.38); animation: cta-glow 2.8s ease-in-out infinite; }
@keyframes cta-glow { 0%, 100% { box-shadow: 0 10px 28px rgba(255, 77, 141, 0.38); } 50% { box-shadow: 0 12px 38px rgba(255, 77, 141, 0.6), 0 0 0 6px rgba(255, 77, 141, 0.10); } }
.action-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.action-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.action-group.subtle { margin-left: auto; padding-left: 14px; border-left: 1px solid var(--border-strong); }
.action-group.subtle .btn { color: var(--muted); }
.action-group.subtle .btn:hover { color: var(--text); }
@media (max-width: 900px) { .action-group.subtle { margin-left: 0; padding-left: 0; border-left: none; } }


/* ===================================================== legibilidade
   Blocos coloridos (rosa/vinho) nunca herdam cinza do tema. */
.card.accent-card, .card.accent-card * { color: #fff; }
.card.accent-card .label, .card.accent-card .kpi .label { color: rgba(255, 255, 255, 0.96); font-weight: 600; }
.card.accent-card .muted, .card.accent-card .small.muted, .card.accent-card .tiny.muted { color: rgba(255, 255, 255, 0.82) !important; }
.card.accent-card .icon, .card.accent-card .kpi .icon { background: rgba(255, 255, 255, 0.22); color: #fff; }
.card.accent-card .delta { background: rgba(255, 255, 255, 0.2) !important; color: #fff !important; }
.card.accent-card .value { color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.card.accent-card .badge { background: rgba(255, 255, 255, 0.22); color: #fff; border-color: transparent; }
.card.accent-card .progress { background: rgba(255, 255, 255, 0.25); }
.card.accent-card .progress > i { background: #fff; }
.card.accent-card .btn { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.card.accent-card .btn:hover { background: rgba(255, 255, 255, 0.28); }
.card.accent-card a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.5); }

.card.dark-card, .card.dark-card * { color: var(--blush); }
.card.dark-card .muted, .card.dark-card .small.muted, .card.dark-card .tiny.muted { color: rgba(243, 231, 234, 0.7) !important; }
.card.dark-card .value { color: #fff; }
.card.dark-card .input { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.card.dark-card .input::placeholder { color: rgba(243, 231, 234, 0.5); }
.card.dark-card .btn:not(.primary) { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.card.dark-card .progress { background: rgba(255, 255, 255, 0.14); }
.card.dark-card .label, .card.dark-card label { color: rgba(243, 231, 234, 0.85); }

/* botões primários e pílulas ativas: texto sempre branco */
.btn.primary, .btn.primary * { color: #fff; }
.pills a.active.lime, .pills button.active.lime, .chip.active.lime { color: #fff; }
.badge.lime, .score.hot, .score.good, .rank { color: var(--sage-ink) !important; }

/* tema claro: tons de aviso e perigo com contraste em fundo branco */
:root[data-theme="light"] { --warn: #b7791f; --danger: #d1345b; --violet: #a83c6d; }
:root[data-theme="light"] .badge.warn { background: rgba(183, 121, 31, 0.12); color: #8a5a10; }
:root[data-theme="light"] .badge.danger { background: rgba(209, 52, 91, 0.12); color: #a5203f; }
:root[data-theme="light"] .badge.pink { background: rgba(233, 34, 111, 0.12); color: #b8125a; }
:root[data-theme="light"] .badge.violet { background: rgba(168, 60, 109, 0.12); color: #7d2a52; }
:root[data-theme="light"] .badge.ok { background: rgba(93, 138, 0, 0.12); color: #4d7300; }
:root[data-theme="light"] .score.hot, :root[data-theme="light"] .badge.lime, :root[data-theme="light"] .rank { background: #c6f542; color: #1f2a05 !important; }
:root[data-theme="light"] .score.good { background: rgba(93, 138, 0, 0.16); color: #3f6100 !important; }
:root[data-theme="light"] .kpi .delta.up { background: rgba(93, 138, 0, 0.12); color: #4d7300; }
:root[data-theme="light"] .pcard .comm b { color: #3f6100 !important; }
:root[data-theme="light"] .accent { color: #b8125a; }
:root[data-theme="light"] .conn-quick { background: rgba(233, 34, 111, 0.07); border-color: rgba(233, 34, 111, 0.35); }
:root[data-heme="light"] .wa-bubble { color: #e9edef; }

/* pílula pequena "R$" e ícones nos KPIs coloridos ficam legíveis */
.card.accent-card .kpi .icon, .card.accent-card .icon { text-shadow: none; }


/* ------------------------------------------------------ categorias */
.cat-strip-wrap { margin: 6px 0 4px; }
.cat-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 4px 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-tile { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 4px; border-radius: 16px; scroll-snap-align: start; transition: transform .35s var(--ease-out), background .2s; position: relative; }
.cat-tile:hover { transform: translateY(-3px); }
.cat-tile.empty { opacity: .45; }
.cat-icon { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 70%); box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 45%, transparent), inset 0 -6px 14px rgba(0,0,0,.15); transition: transform .4s var(--ease-spring), box-shadow .3s; }
.cat-tile:hover .cat-icon { transform: scale(1.06) rotate(-3deg); }
.cat-tile.active .cat-icon { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent), 0 10px 26px color-mix(in srgb, var(--c) 50%, transparent); transform: scale(1.06); }
.cat-name { font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.15; max-width: 92px; }
.cat-tile.active .cat-name { color: var(--text); }
.cat-count { position: absolute; top: 4px; right: 10px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.cat-tile.active .cat-count { background: var(--accent); color: #fff; border-color: transparent; }
.sub-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 4px 10px; animation: head-in .4s var(--ease-out); }
.sub-strip .chip.muted { opacity: .55; }
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cat-pick label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 12.5px; font-weight: 600; transition: border-color .2s, background .2s; }
.cat-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cat-pick input { accent-color: var(--accent); }
.cat-pick .cat-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--c); box-shadow: none; }
.cat-pick .cat-icon svg.i { width: 18px; height: 18px; stroke-width: 2.2; color: #fff; filter: none; }
.cat-pick label { padding: 9px 12px; gap: 10px; }
.cat-pick label:has(input:checked) .cat-icon { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.cat-pick input { width: 16px; height: 16px; flex: none; }
.pcard .cat-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); max-width: 100%; }
.pcard .cat-chip i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; background: var(--c); }

.products-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.runs-acc summary { padding: 4px 2px; }
#seeds-modal .list .row { padding: 9px 0; }

/* selo de novidade no minerador */
.pcard .new-badge { position: absolute; left: 10px; bottom: 10px; background: var(--sage); color: var(--sage-ink); font-weight: 800; font-size: 11px; padding: 5px 10px; border-radius: 999px; box-shadow: 0 6px 16px rgba(214,255,92,.35); letter-spacing: .01em; }
.pcard.is-new { border-color: rgba(214,255,92,.35); }
.pcard.is-new:hover { box-shadow: 0 14px 40px rgba(214,255,92,.18), var(--shadow); }
.btn.live { background: linear-gradient(135deg, var(--sage), #b8ef2a); color: var(--sage-ink); border-color: transparent; font-weight: 700; box-shadow: 0 8px 22px rgba(214,255,92,.3); }
.btn.live:hover { box-shadow: 0 10px 30px rgba(214,255,92,.45); }

/* ---------------------------------------------------- hoje / setup */
.today-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.today-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); position: relative; transition: transform .35s var(--ease-out), box-shadow .35s; }
.today-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.today-card.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border: none; color: #fff; box-shadow: 0 14px 36px rgba(255,77,141,.35); }
.today-card.primary *, .today-card.primary .today-label { color: #fff; }
.today-card.warn { border-color: rgba(228,179,106,.5); }
.today-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); flex: none; }
.today-card.primary .today-icon { background: rgba(255,255,255,.2); }
.today-num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.today-label { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.today-cta { margin-left: auto; font-size: 12.5px; font-weight: 700; white-space: nowrap; opacity: .85; }
.setup-card { border-color: rgba(214,255,92,.35); }
.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.setup-step { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.setup-step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--accent); color: #fff; flex: none; }
.setup-step.done { opacity: .6; } .setup-step.done .n { background: var(--sage); color: var(--sage-ink); }
@media (max-width: 900px) { .today-grid, .setup-steps { grid-template-columns: 1fr; } }
/* fila: passos numerados */
.q-steps { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.q-steps .btn { position: relative; }
.q-steps .step-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.18); font-size: 10.5px; font-weight: 800; margin-right: 4px; }
.q-steps .btn.dark .step-n { background: var(--sage); color: var(--sage-ink); }
.q-item.sent { opacity: .45; }

/* ---------- Ícones SVG (sem emoji) ---------- */
svg.i { display: inline-block; vertical-align: -0.16em; flex: none; }
.btn svg.i, .chip svg.i, .badge svg.i, .pills svg.i { vertical-align: -0.2em; margin-right: 2px; }
.btn.lg svg.i { margin-right: 4px; }
.im { display: inline-flex; align-items: center; gap: 3px; }
.nav a .ic svg.i, .kpi .icon svg.i, .today-icon svg.i { margin: 0; vertical-align: middle; }
.cat-icon svg.i { color: #fff; stroke-width: 2.1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.pcard .cat-chip i svg.i { color: #fff; }
.score svg.i { margin-right: 2px; }
.new-badge svg.i { margin-right: 2px; }
.today-cta svg.i { transition: transform .25s; }
.today-card:hover .today-cta svg.i { transform: translateX(3px); }
.fav svg.i { transition: transform .25s var(--ease-spring); }
.fav.on svg.i { color: var(--accent); }
.fav:hover svg.i { transform: scale(1.15); }
.setup-step .n svg.i { vertical-align: middle; }
.conn-logo svg.i { width: 24px; height: 24px; }
.noimg svg.i { opacity: .45; }
.iconbtn svg.i { vertical-align: middle; }

/* ---------- Tabelas ordenáveis ---------- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .2s; }
th.sortable:hover { color: var(--accent); }
th.sortable .sort-ind { display: inline-block; width: 10px; margin-left: 2px; opacity: .35; font-size: 10px; }
th.sortable .sort-ind::after { content: "⇅"; }
th.sortable.asc .sort-ind, th.sortable.desc .sort-ind { opacity: 1; color: var(--accent); }
th.sortable.asc .sort-ind::after { content: "▲"; }
th.sortable.desc .sort-ind::after { content: "▼"; }
th.sortable.asc, th.sortable.desc { color: var(--accent); }

tr.row-imported td { background: color-mix(in srgb, var(--sage) 12%, transparent); }

.btn.wa-send { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 8px 22px rgba(37,211,102,.3); }
.btn.wa-send:hover { box-shadow: 0 10px 30px rgba(37,211,102,.45); transform: translateY(-1px); }
.btn.wa-send.done { filter: saturate(.6); }

.mine-badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .02em; background: var(--sage); color: var(--sage-ink); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.pcard.is-new .mine-badge { bottom: 40px; }
.chip.mine-chip.active { background: var(--sage); color: var(--sage-ink); border-color: transparent; }
.chip.mine-chip.active .muted { color: inherit; opacity: .7; }

/* cabeçalho fixo em tabelas longas (busca ao vivo) */
:root { --topbar-h: 72px; }
.table.sticky-head thead th { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 5; box-shadow: 0 1px 0 var(--border), 0 8px 18px -12px rgba(0,0,0,.35); }

/* =====================================================================
   MOBILE — camada dedicada (≤ 760px). App de verdade: barra de abas
   inferior, gaveta "Mais", folhas de baixo para modais, cards no lugar
   de tabelas, alvos de toque ≥ 44px e áreas seguras do iPhone.
   ===================================================================== */
.tabbar { display: none; }
.backdrop { display: none; }
.drawer-close { display: none; }
.only-m { display: none !important; }
:root { --tabbar-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); overscroll-behavior-y: none; }
  .only-m { display: inline-grid !important; }
  .hide-m { display: none !important; }

  /* ---- topo compacto ---- */
  .topbar { padding: calc(10px + var(--safe-t)) 14px 10px; gap: 8px; }
  .topbar .title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  .topbar .spacer { display: none; }
  .topbar-search { display: none !important; }
  .topbar .avatar, .iconbtn { width: 38px; height: 38px; border-radius: 11px; flex: none; }
  .menu-toggle { display: none !important; }

  /* ---- barra de abas inferior ---- */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 6px calc(6px + var(--safe-b));
    background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: none; background: none;
    color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; border-radius: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: color .2s, transform .2s var(--ease-spring);
  }
  .tabbar a:active, .tabbar button:active { transform: scale(.92); }
  .tabbar svg.i { width: 23px; height: 23px; stroke-width: 1.9; transition: transform .25s var(--ease-spring); }
  .tabbar .active { color: var(--accent); }
  .tabbar .active svg.i { transform: translateY(-1px) scale(1.06); stroke-width: 2.3; }
  .tabbar .active::before { content: ""; position: absolute; top: -7px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
  .tabbar .tb-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-2); }

  /* ---- gaveta "Mais" (a sidebar vira drawer) ---- */
  .backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.drawer-open .backdrop { opacity: 1; pointer-events: auto; }
  .sidebar { position: fixed; z-index: 80; inset: 0 auto 0 0; width: min(86vw, 340px); height: 100dvh; transform: translateX(-104%); transition: transform .32s var(--ease-out); padding: calc(16px + var(--safe-t)) 14px calc(16px + var(--safe-b)); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.45); }
  .drawer-close { display: grid; position: absolute; top: calc(14px + var(--safe-t)); right: 12px; }
  .nav a { padding: 12px 12px; font-size: 15px; }
  .nav a .ic { width: 34px; height: 34px; }

  /* ---- conteúdo ---- */
  .content { padding: 16px 14px 24px; }
  h1 { font-size: 23px; letter-spacing: -.02em; line-height: 1.15; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .page-head p { font-size: 13.5px; }
  .page-head .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head .btn-row .btn { justify-content: center; }
  .card { padding: 16px; border-radius: 20px; }
  .card.pad-sm { padding: 12px; }
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-head .btn-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 .span-2, .grid-4 .span-3 { grid-column: span 2; }
  .kpi .value { font-size: 24px; }
  .kpi .label { font-size: 12px; }
  .today-grid { gap: 10px; }
  .today-card { padding: 14px; }
  .btn, .input, select.input { min-height: 44px; }
  .btn.sm { min-height: 40px; }
  .btn.xs { min-height: 34px; }
  .input, select.input, textarea.input { font-size: 16px; }   /* evita zoom do iOS ao focar */
  .btn-row { gap: 8px; }

  /* ---- pílulas e chips rolam na horizontal, sem quebrar ---- */
  .pills { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pills a, .pills button { white-space: nowrap; padding: 9px 14px; }
  .chips { gap: 6px; }
  .chip { padding: 8px 12px; min-height: 38px; }
  #filters .flex.gap-2 { flex-direction: column; align-items: stretch; }
  #filters .flex.gap-2 > * { width: 100% !important; }
  #filters .pills { align-self: flex-start; max-width: 100%; }
  #filters .btn.primary.sm { width: 100%; justify-content: center; }
  .cat-strip { gap: 8px; padding: 6px 2px 10px; scroll-snap-type: x mandatory; }
  .cat-tile { scroll-snap-align: start; min-width: 64px; }
  .cat-icon { width: 52px; height: 52px; }
  .cat-icon svg.i { width: 22px; height: 22px; }
  .cat-count { top: -2px; right: -2px; }
  .sub-strip { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; scrollbar-width: none; }
  .sub-strip .chip { white-space: nowrap; }

  /* ---- produtos: 2 colunas compactas ---- */
  .products, .products-wide { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .pcard { border-radius: 16px; }
  .pcard .body { padding: 10px 10px 12px; gap: 6px; }
  .pcard .title { font-size: 12.5px; line-height: 1.3; }
  .pcard .price { font-size: 15px; }
  .pcard .price s { font-size: 11px; }
  .pcard .comm b { font-size: 13px; }
  .pcard .comm span { font-size: 10.5px; }
  .pcard .meta { font-size: 10.5px; gap: 6px; }
  .pcard .btn.block { min-height: 38px; font-size: 12.5px; }
  .pcard .store-tag.has-logo { width: 28px; height: 28px; border-radius: 8px; }
  .pcard .store-tag.has-logo img { width: 18px; height: 18px; }
  .pcard .rank { font-size: 10px; padding: 3px 7px; }
  .pcard .new-badge { font-size: 9.5px; padding: 3px 7px; }
  .pcard .cat-chip { max-width: 110px; }
  .pcard .fav { width: 32px; height: 32px; }

  /* ---- ações do minerador ---- */
  .action-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .action-bar .btn { min-width: 0; }
  .action-bar .btn .badge { flex: none; }
  .action-bar > form { display: contents; }
  .action-bar .btn.lg { grid-column: span 1; width: 100%; justify-content: center; padding: 12px 8px; font-size: 13.5px; white-space: normal; line-height: 1.15; }
  .action-bar .btn { width: 100%; }
  .action-group { display: contents; }
  .action-group .btn { justify-content: center; }
  .action-group.subtle { display: flex; grid-column: span 2; justify-content: space-between; gap: 6px; }
  .action-group.subtle .btn { flex: 1; }

  /* ---- fila: ações em grade de 6 colunas, na ordem de uso ---- */
  .q-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .q-steps > * { min-width: 0; }
  .q-steps > .btn, .q-steps > a.btn { justify-content: center; padding: 10px 6px; font-size: 12.5px; }
  .q-steps > .btn.wa-send { order: -3; grid-column: span 6; min-height: 50px; font-size: 15px; }
  .q-steps > .btn:has(.step-n) { grid-column: span 3; }
  .q-steps > .btn:has(.step-n):not(.wa-send) { order: -2; }
  .q-steps > form.q-sent { order: -1; grid-column: span 6; }
  .q-steps > form.q-sent .btn { width: 100%; min-height: 46px; justify-content: center; }
  .q-steps > a.btn.xs, .q-steps > .btn.xs { grid-column: span 2; min-height: 38px; }
  .q-steps > form:not(.q-sent) { grid-column: span 2; }
  .q-steps > form:not(.q-sent) .btn { width: 100%; min-height: 38px; justify-content: center; }
  .q-steps > details { grid-column: span 4; }
  .q-steps > details summary { width: 100%; justify-content: center; min-height: 38px; }
  .q-steps .step-n { display: none; }
  .wa-wrap { padding: 8px !important; }
  .wa-bubble { font-size: 13px !important; }

  /* ---- tabelas ---- */
  .tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
  .tscroll .table { min-width: 560px; }
  /* tabela que vira lista de cards (data-label em cada célula) */
  .table.as-cards, .table.as-cards tbody, .table.as-cards tr, .table.as-cards td { display: block; width: 100%; min-width: 0; }
  .table.as-cards thead { display: none; }
  .table.as-cards tr { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 12px; margin-bottom: 10px; position: relative; }
  .table.as-cards td { border: none; padding: 4px 0; text-align: left !important; }
  .table.as-cards td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 92px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
  .table.as-cards td.cell-main { padding-right: 40px; }
  .table.as-cards td.cell-check { position: absolute; top: 12px; right: 12px; width: auto; padding: 0; }
  .table.as-cards td.cell-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
  .table.as-cards td.cell-actions .flex { display: contents; }
  .table.as-cards td.cell-actions .btn { justify-content: center; min-height: 40px; }
  .table.as-cards .kv-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
  .table.as-cards .kv-row div { font-size: 12.5px; }
  .table.as-cards .kv-row small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .sort-m { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .sort-m .chip { white-space: nowrap; }

  /* ---- modais viram folhas de baixo ---- */
  .modal { place-items: end center; }
  .modal .box { width: 100% !important; max-width: 100%; max-height: 92dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 14px 16px calc(20px + var(--safe-b)); transform: translateY(40px); }
  .modal.open .box { transform: none; }
  .modal .box::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--border-strong); margin: 0 auto 14px; }
  .modal .card-head { position: sticky; top: 0; background: var(--surface); z-index: 1; padding-bottom: 8px; }

  /* ---- avisos e barras flutuantes acima da tabbar ---- */
  .flash { left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
  .sticky-actions { bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); }
  .sticky-actions .card { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .sticky-actions .card select.input, .sticky-actions .card input.input { width: 100% !important; }
  .table.sticky-head thead th { top: calc(var(--topbar-h) + 0px); }

  /* ---- página do produto ---- */
  .product-cta { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 55; display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; padding: 8px; border-radius: 20px; background: color-mix(in srgb, var(--bg-2) 90%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
  .product-cta .btn { min-height: 48px; justify-content: center; font-size: 14.5px; }
  body.has-product-cta { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }
  .kv { grid-template-columns: auto 1fr; font-size: 13.5px; }
  .conn-grid { grid-template-columns: 1fr; }
  .cat-pick { grid-template-columns: 1fr 1fr; }
  .cat-pick label { padding: 8px; font-size: 12px; gap: 8px; }
  .cat-pick .cat-icon { width: 28px; height: 28px; }
  .cat-pick .cat-icon svg.i { width: 15px; height: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .setup-steps { grid-template-columns: 1fr; }
  .conn-foot { grid-template-columns: 1fr; }
  .search.grow input { min-width: 0; }
  .empty { padding: 28px 16px; }
  .empty .btn-row { flex-direction: column; }
  .empty .btn-row .btn { width: 100%; justify-content: center; }
  /* movimento mais leve no celular */
  .reveal { transition-duration: .4s; }
  .pcard:hover { transform: none; }
}
@media (max-width: 380px) {
  .tabbar a span, .tabbar button span { font-size: 10px; }
  .products, .products-wide { gap: 8px; }
  .pcard .title { font-size: 12px; }
}
/* PWA em tela cheia (adicionada à tela inicial) */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(12px + var(--safe-t)); }
}
.product-cta { display: none; }
@media (max-width: 760px) { .product-cta { display: grid; } }

@media (max-width: 760px) {
  .table.as-cards-m, .table.as-cards-m tbody, .table.as-cards-m tr, .table.as-cards-m td { display: block; width: 100%; min-width: 0; }
  .table.as-cards-m thead { display: none; }
  .table.as-cards-m tr { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 12px; margin-bottom: 10px; position: relative; }
  .table.as-cards-m td { border: none; padding: 0; text-align: left !important; }
  .table.as-cards-m td.cell-main { padding-right: 36px; }
  .table.as-cards-m td.cell-main .thumb { width: 64px; height: 64px; border-radius: 12px; }
  .table.as-cards-m td.cell-check { position: absolute; top: 12px; right: 12px; width: auto; }
  .table.as-cards-m td.cell-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
  .table.as-cards-m td.cell-actions .flex { display: contents; }
  .table.as-cards-m td.cell-actions .btn { justify-content: center; min-height: 40px; font-size: 13px; }
  .table.as-cards-m .kv-row { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12.5px; }
  .table.as-cards-m .kv-row small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .table.as-cards-m tr.row-imported { border-color: var(--sage); }
  .tscroll:has(.as-cards-m) { overflow: visible; margin: 0; padding: 0; }
  .tscroll .table.as-cards-m { min-width: 0; }
  .import-row { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; }
  .import-row .btn { justify-content: center; }
  .card-head:has(.import-row) { flex-direction: column; align-items: stretch; gap: 10px; }
  .sort-m .chip.active { background: var(--accent); color: #fff; border-color: transparent; }
}

@media (max-width: 760px) {
  .product-grid { display: flex; flex-direction: column; }
  .product-grid > .span-2 { order: -1; }
  .card > div[style*="aspect-ratio:1"] { aspect-ratio: 4 / 3 !important; }
}

/* minerador: ferramentas discretas alinhadas ao topo, na linha do título */
.mining-head { align-items: flex-start; }
.action-group.subtle.tools-top { margin-left: auto; padding-left: 0; border-left: none; flex: none; padding-top: 6px; }
.tools-top .btn { white-space: nowrap; }
.action-bar { margin-top: -4px; }
@media (max-width: 760px) {
  .tools-top { margin-left: 0; padding-top: 0; display: flex; gap: 6px; }
  .tools-top .btn { flex: 1; justify-content: center; }
}

/* catálogo: barra de filtros em uma linha; a busca envia pelo Enter ou pela seta */
.search-go { position: relative; }
.search-go input { padding-right: 46px; }
.search-go .go { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease-spring), box-shadow .2s; }
.search-go .go:hover { transform: translateY(-50%) scale(1.06); box-shadow: 0 6px 16px rgba(255,77,141,.35); }
#filters > .flex.gap-2 { flex-wrap: nowrap; }
#filters > .flex.gap-2 > .pills, #filters > .flex.gap-2 > .chip { flex: none; }
#filters > .flex.gap-2 > .pills a, #filters > .flex.gap-2 > .pills button { padding: 7px 12px; font-size: 12.5px; }
@media (max-width: 1240px) { #filters > .flex.gap-2 { flex-wrap: wrap; } #filters > .flex.gap-2 > .search-go { flex-basis: 100%; } }
@media (max-width: 760px) { #filters > .flex.gap-2 { flex-wrap: wrap; } .search-go .go { width: 36px; height: 36px; } }
@media (max-width: 760px) {
  /* nada pode empurrar a página para o lado */
  .grid > *, .flex > *, .card, .card-head, .col > * { min-width: 0; }
  .card { overflow-wrap: anywhere; }
  .badge.danger, .badge.warn { white-space: normal; }
  .wa-bubble { max-width: 100% !important; }
  .bars, .legend { max-width: 100%; overflow: hidden; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-head .search { width: 100% !important; }
  .truncate { min-width: 0; }
  .tiny.muted { overflow-wrap: anywhere; }
  .nowrap { white-space: normal; }
  img, svg, video { max-width: 100%; }
  .flex.gap-2.flex-wrap > .pills { max-width: 100%; }
  .sidebar:not(.open) { visibility: hidden; }
  .sidebar.open { visibility: visible; }
}
@media (max-width: 760px) {
  .q-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .q-steps .btn, .q-steps summary { white-space: normal; min-width: 0; line-height: 1.15; }
  .btn-row { flex-wrap: wrap; }
  .btn-row .btn { white-space: normal; }
  .flex.between.mb-2.flex-wrap { flex-direction: column; align-items: stretch; }
  .flex.between.mb-2.flex-wrap > .pills { align-self: flex-start; max-width: 100%; }
}
@media (max-width: 760px) {
  /* catálogo: filtros compactos em grade */
  #filters > .flex.gap-2 { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  #filters > .flex.gap-2 > .search-go { grid-column: span 2; }
  #filters > .flex.gap-2 > select { grid-column: span 2; width: 100% !important; }
  #filters > .flex.gap-2 > .pills { grid-column: span 2; width: 100%; display: flex; }
  #filters > .flex.gap-2 > .pills a, #filters > .flex.gap-2 > .pills button { flex: 1; text-align: center; justify-content: center; }
  #filters > .flex.gap-2 > .chip { width: 100%; justify-content: center; }
  #filters > .flex.gap-2 > .btn.ghost { grid-column: span 2; justify-content: center; }
  #filters .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #filters .chips .chip { white-space: nowrap; flex: none; }
  .cat-tile { width: 66px; min-width: 66px; padding: 4px 2px; gap: 5px; }
  .cat-icon { width: 46px; height: 46px; }
  .cat-icon svg.i { width: 20px; height: 20px; }
  .cat-name { font-size: 10.5px; }
  .cat-count { font-size: 9.5px; min-width: 16px; height: 16px; }
  .cat-strip { padding-bottom: 6px; }
}

.link-code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 760px) {
  .link-row .link-code { flex-basis: 100%; }
  .link-row .btn { flex: 1; justify-content: center; }
  .card-head form.flex.gap-1 { width: 100%; }
  .card-head form.flex.gap-1 select { width: 100%; }
  .tiny.muted.mt-2 .mono { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 760px) {
  .modal .card-head { flex-wrap: nowrap; align-items: flex-start; }
  .modal .card-head > .btn { flex: none; }
  .modal .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal .form-grid .full, .modal .field.full { grid-column: span 2; }
}
@media (max-width: 760px) { .sort-m.only-m { display: flex !important; flex-wrap: nowrap; overflow-x: auto; } .sort-m .chip { flex: none; } }

/* lista de opções com interruptor (perfil de mineração e afins) */
.opt-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; cursor: pointer; border-top: 1px solid var(--border); transition: background .15s; }
.opt:first-child { border-top: none; }
.opt:hover { background: var(--surface-3); }
.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-text b { font-size: 13.5px; font-weight: 600; }
.opt-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.opt .switch { flex: none; }
.form-grid .full.btn-row { justify-content: flex-end; }

/* ---- saúde do minerador ---- */
.miner-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-radius: 18px; border: 1px solid; }
.miner-banner.stopped { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.miner-banner.slow { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.miner-banner .mb-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.miner-banner.stopped .mb-icon { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.miner-banner.slow .mb-icon { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.miner-banner b { font-size: 14.5px; }
.miner-banner .small { color: var(--text-2); margin-top: 2px; }
.miner-banner form, .miner-banner > .btn { flex: none; }
.miner-pill { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; margin-left: 10px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0; border: 1px solid var(--border); background: var(--surface); }
.miner-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.miner-pill.ok i { background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: livepulse 1.8s infinite; }
.miner-pill.ok { color: #3ddc84; }
.miner-pill.slow i { background: var(--warn); } .miner-pill.slow { color: var(--warn); }
.miner-pill.stopped i { background: var(--danger); } .miner-pill.stopped { color: var(--danger); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.55); } 70% { box-shadow: 0 0 0 8px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.tabbar .tb-alert { position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg-2); }
.nav a .nav-alert { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.seed-toggle { display: flex; align-items: center; }
@media (max-width: 760px) {
  .miner-banner { flex-wrap: wrap; }
  .miner-banner form, .miner-banner > .btn { width: 100%; }
  .miner-banner .btn { width: 100%; justify-content: center; }
  .miner-pill { display: flex; width: fit-content; margin: 8px 0 0; }
}

/* =====================================================================
   AUDITORIA v2 — componentes novos
   ===================================================================== */
/* dinheiro = verde; ação = rosa; nota = neutro */
:root { --money: #d6ff5c; --money-ink: #1f2a05; --money-soft: rgba(214,255,92,.12); }
[data-theme="light"] { --money: #3f7a00; --money-ink: #ffffff; --money-soft: rgba(63,122,0,.10); }

.toast-copy { display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.toast-copy.has-action button { border: none; background: none; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; padding: 4px 2px; white-space: nowrap; }
[data-theme="light"] .toast-copy.has-action button { color: #ff7ab0; }
.link-btn { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 8px 10px; margin: -8px -10px; border-radius: 10px; }
.link-btn:hover { color: var(--accent); background: var(--accent-soft); }
.modal-x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.modal-x:hover { color: var(--text); border-color: var(--border-strong); }
.note { padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.note.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.kpi-foot { margin-top: 10px; font-size: 13px; font-weight: 500; }
.products-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* ---------- página do produto ---------- */
.product-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.product-summary { padding: 0; overflow: hidden; position: sticky; top: calc(var(--topbar-h, 72px) + 16px); }
.ps-media { position: relative; aspect-ratio: 1; background: #fff; }
.ps-media img { width: 100%; height: 100%; object-fit: contain; }
.ps-media .noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.ps-store { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; background: #fff; color: #111; font-size: 11.5px; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.ps-fav { position: absolute; top: 10px; right: 10px; }
.ps-fav .fav { width: 40px; height: 40px; }
.ps-body { padding: 18px; }
.ps-title { font-size: 20px; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
.ps-full { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ps-price { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.ps-now { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ps-price s { margin-left: 8px; color: var(--muted); font-size: 14px; }
.ps-comm { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--money-soft); font-size: 13.5px; }
.ps-comm b { color: var(--money); font-size: 17px; font-variant-numeric: tabular-nums; }
.ps-comm span { color: var(--muted); }
.ps-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fact { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-2); }
.fact.danger { color: var(--danger); }
.ps-cat { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.ps-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.headline-row { display: flex; gap: 8px; }
.headline-row .input { flex: 1; min-width: 0; }
.ai-out:empty { display: none; }
.ai-out { margin: 8px 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ai-out .card { margin: 0 !important; }
.fmt-pills { margin-top: 14px; }
.style-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.variant.swap-in { animation: swapIn .35s var(--ease-out); }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wa-bubble .wa-img { display: block; width: 100%; max-width: 280px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #fff; }
.send-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.send-row .btn.wa-send { min-height: 46px; padding: 0 20px; font-size: 15px; }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 240px; padding: 8px; display: flex; flex-direction: column; gap: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.more-pop .btn { justify-content: flex-start; width: 100%; }
.more-pop .sched { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
.fold { padding: 0; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; font-weight: 600; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.fold > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-left: 4px; flex: none; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-body { padding: 0 20px 18px; }
.dest .mono { word-break: break-all; }
@media (max-width: 1100px) { .product-layout { grid-template-columns: minmax(0, 1fr); } .product-summary { position: static; } }

/* ---------- fila ---------- */
.q-card.sent { opacity: .55; }
.q-card.sent .wa-send { filter: saturate(.4); }

/* ---------- miner banner no card da home ---------- */
.card.kpi .miner-pill { margin-left: 0; }
@media (max-width: 760px) {
  /* produto no celular: foto e preço primeiro, compacto; mensagem logo abaixo; resto recolhido */
  body.page-product .tabbar { display: none; }
  body.page-product { padding-bottom: calc(84px + var(--safe-b)) !important; }
  body.page-product .product-cta { bottom: calc(10px + var(--safe-b)); }
  .product-layout { gap: 12px; }
  .product-summary { display: grid; grid-template-columns: 116px minmax(0, 1fr); column-gap: 12px; padding: 12px; align-items: start; }
  .ps-body { display: contents; }
  .ps-media { grid-column: 1; grid-row: 1 / span 3; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
  .ps-title, .ps-price, .ps-comm { grid-column: 2; }
  .ps-full { display: none; }
  .ps-facts, .ps-cat, .ps-actions, .ps-body > .tiny { grid-column: 1 / -1; }
  .ps-store { top: 6px; left: 6px; padding: 3px 6px 3px 4px; font-size: 10px; }
  .ps-fav { top: auto; bottom: 6px; right: 6px; }
  .ps-fav .fav { width: 32px; height: 32px; }
  .ps-title { font-size: 16px; }
  .ps-price { margin-top: 4px; flex-wrap: wrap; gap: 4px; }
  .ps-now { font-size: 19px; }
  .ps-comm { margin-top: 6px; padding: 6px 8px; font-size: 12px; }
  .ps-comm b { font-size: 14px; }
  .ps-facts { margin-top: 12px; }
  .ps-actions .btn, .ps-actions form { flex: 1; }
  .ps-actions form .btn { width: 100%; }
  .headline-row { flex-direction: column; }
  .send-row .wa-send, .send-row [onclick^="waSendToGroup"] { display: none; } /* a barra fixa já faz isso */
  .send-row { display: grid; grid-template-columns: 1fr 1fr; }
  .send-row .btn, .more-menu > summary { width: 100%; justify-content: center; }
  .more-pop { right: 0; left: auto; min-width: min(300px, calc(100vw - 32px)); }
  .fold > summary { padding: 14px 16px; }
  .fold-body { padding: 0 16px 16px; }
  .wa-bubble .wa-img { max-width: 100%; }
}

.only-m-block { display: none; }
@media (max-width: 760px) {
  .only-m-block { display: block; }
  .ps-extra.hide-m { display: none !important; }
  .fact { padding: 4px 8px; font-size: 11.5px; }
  .ps-facts { gap: 4px; }
  .headline-row { flex-direction: row; }
  .headline-row .btn { padding: 0 12px; flex: none; }
  .headline-row .btn { font-size: 0; gap: 0; } .headline-row .btn svg.i { margin: 0; }
}
@media (max-width: 760px) { .wa-bubble .wa-img { max-width: 220px; } #mensagem .card-head .sub { display: none; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pager a:first-child svg.i { transform: rotate(180deg); }
@media (max-width: 760px) {
  .links-table td.cell-actions { grid-template-columns: 1fr 1fr auto; }
  .links-table td.cell-actions form .btn { width: auto; }
}

.tscroll .table.fit, .table.fit { min-width: 0 !important; }
.table.fit th, .table.fit td { white-space: normal; }

/* animações de entrada: rápidas e sem desfoque (auditoria A6) */
:root { --dur: 260ms; }
html.js .reveal { transform: translateY(8px); filter: none !important; will-change: transform, opacity; }
html.js .reveal.in { transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); }
html.js .reveal.in .list .row, html.js .reveal.in .table tbody tr { animation-duration: .25s; animation-delay: 0s !important; }
html.js .reveal.in .bars .b i { animation-duration: .45s; }
html.js .reveal.in .progress > i { animation-duration: .5s; animation-delay: .05s; }
html.theme-anim, html.theme-anim * { transition: background-color .3s, color .3s, border-color .3s !important; }

body.modal-lock { overflow: hidden; }
.modal .box { overscroll-behavior: contain; }

.clear-btn.is-idle { visibility: hidden; }
@media (max-width: 760px) { .clear-btn.is-idle { display: none !important; } }

/* ---------- card de produto limpo (auditoria M1/M2) ---------- */
.pcard .img .store-tag, .pcard .img .store-tag.shift, .pcard .img .store-tag.has-logo.shift { left: 10px; top: 10px; }
.pcard .fav { background: rgba(0,0,0,.4); }
.pcard .pc-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pcard .pc-top .cat-chip { margin-left: auto; min-width: 0; }
.pcard .sel { position: static; display: inline-flex; }
.pcard .sel .check { width: 18px; height: 18px; }
.pcard .rank { position: static; animation: none; background: var(--surface-3); color: var(--text) !important; font-size: 11px; padding: 2px 7px; }
.score-n { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; flex: none; }
.score-n.hot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.score-n.good { color: var(--text); }
.pcard .price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.pcard .price .badge { margin-left: auto; font-size: 10.5px; padding: 2px 7px; }
.pcard .comm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--money-soft) !important; }
.pcard .comm b { color: var(--money) !important; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.pcard .comm span { font-size: 11.5px; color: var(--text-2); }
.pcard .new-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 700; }
.pcard .mine-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-weight: 700; }
.pcard.is-new { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.pcard.is-new:hover { box-shadow: 0 14px 40px rgba(255,77,141,.16), var(--shadow); }
.products, .products-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (min-width: 1200px) and (max-width: 1600px) { .content .products:not(.products-3), .content .products-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* uma cor de ação (rosa) e uma cor de dinheiro (verde) */
.btn.live { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.live:hover { border-color: var(--accent); box-shadow: none; }
.btn.live svg.i { color: var(--accent); }
.chip.mine-chip.active { background: var(--accent); color: #fff; }
.pills a.active.lime, .pills button.active.lime { background: var(--accent); color: #fff; }
@media (max-width: 760px) {
  .pcard .pc-top .cat-chip { display: none; }
  .pcard .comm span { font-size: 10.5px; }
  .pcard .price .badge { margin-left: 0; }
}

.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--border); }
.alert-row:first-child { border-top: none; }
.alert-row.is-read { opacity: .55; }
.alert-row .thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: #fff; }
.alert-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 760px) {
  .alert-row { flex-wrap: wrap; align-items: flex-start; }
  .alert-row .grow { flex: 1 1 calc(100% - 64px); }
  .alert-actions { width: 100%; }
  .alert-actions .btn.primary { flex: 1; justify-content: center; }
}
.kv-wide { grid-template-columns: auto 1fr; } .kv-wide dd { text-align: right; font-weight: 500; }
.tpl-prev { font-size: 12px; color: var(--text-2); white-space: pre-wrap; max-height: 96px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }

.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .chev { width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 6px; }
.nav-group[open] > summary .chev { transform: rotate(-135deg); }
.nav-group > summary:hover { color: var(--text); }
@media (max-width: 760px) { .sidebar .nav a.in-tabbar { display: none; } .nav-group { } }

/* contraste AA em superfícies rosa (auditoria M4) */
.card.accent-card { background: linear-gradient(140deg, #e8327a 0%, #c81e63 50%, #8f1446 100%); }
.card.accent-card .label, .card.accent-card .small, .card.accent-card .kpi-foot, .card.accent-card .muted, .card.accent-card .delta { color: #fff !important; opacity: 1 !important; font-weight: 600; }
.card.accent-card .delta { background: rgba(0,0,0,.22) !important; }
.today-card.primary { background: linear-gradient(135deg, #e8327a, #b81a5a); }
.today-card.primary .today-label, .today-card.primary .today-cta { color: #fff; opacity: 1; font-weight: 600; }
.today-card.warn .today-label { color: var(--text); }
.note.warn, .badge.warn { color: var(--text); }
[data-theme="dark"] .badge.warn, :root:not([data-theme="light"]) .badge.warn { color: #f3d19a; }
[data-theme="light"] .badge.warn { color: #7a4a00; background: rgba(228,179,106,.22); }
/* grids que se ajustam sozinhos (auditoria M3) */
.today-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.today-card { min-width: 0; }
.today-card .today-cta { white-space: nowrap; }
@media (max-width: 1300px) { .products-3 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important; } }
@media (min-width: 761px) and (max-width: 1100px) { .grid-3 > .span-2 { grid-column: 1 / -1; } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.content { overflow-x: clip; }
/* alvos de toque (auditoria M6) */
@media (pointer: coarse) {
  .link-btn { display: inline-flex; align-items: center; min-height: 44px; }
  .btn.xs { min-height: 36px; padding-left: 12px; padding-right: 12px; }
  .pcard .fav { width: 40px; height: 40px; }
  .check, .pcard .sel .check { width: 22px; height: 22px; }
  .pcard .sel { padding: 6px; margin: -6px; }
  .chip { min-height: 40px; }
}

/* busca ao vivo */
.live-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.live-form .search { flex: 1 1 320px; }
.live-form select.input { width: auto; min-width: 150px; }
.search-loading { display: none; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; }
body.is-searching .search-loading { display: flex; }
body.is-searching .live-form ~ .card, body.is-searching .live-form ~ .empty, body.is-searching .live-form ~ .note { display: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.money { color: var(--money); }
.import-all:disabled { opacity: .45; cursor: default; }
@media (max-width: 760px) {
  .live-form { display: grid; grid-template-columns: 1fr 1fr; }
  .live-form .search { grid-column: 1 / -1; }
  .live-form select.input { width: 100%; min-width: 0; }
  .live-form select[name="sort"] { grid-column: 1 / -1; }
  .live-form .switch { grid-column: 1 / -1; }
  .live-form .btn.primary { grid-column: 1 / -1; justify-content: center; }
  .table.as-cards-m td.cell-actions { grid-template-columns: 1fr 1fr 1fr; }
  .import-all { width: 100%; justify-content: center; }
}
.bars .b i[style*="height:0%"], .bars .b i[style*="height:0.0%"] { visibility: hidden; }
@media (max-width: 1560px) and (min-width: 761px) {
  #filters > .flex.gap-2 { flex-wrap: wrap; }
  #filters > .flex.gap-2 > .search-go { flex: 1 1 100%; }
  #filters > .flex.gap-2 > select { width: 220px !important; }
}

@media (max-width: 760px) {
  #filters > .flex.gap-2 { grid-template-columns: auto 1fr; }
  #filters .filters-toggle { grid-column: 1; min-height: 46px; }
  #filters > .flex.gap-2 > .search-go { grid-column: 2; }
  #filters:not(.show-filters) > .flex.gap-2 > select,
  #filters:not(.show-filters) > .flex.gap-2 > .pills,
  #filters:not(.show-filters) > .chips,
  #filters:not(.show-filters) > details.acc { display: none !important; }
  #filters > .flex.gap-2 > .chip { grid-column: span 1; }
  #filters.show-filters .filters-toggle { background: var(--accent-soft); border-color: var(--accent); }
  .pcard .fav { width: 34px; height: 34px; }
  .links-page-grid > .card.span-2 { order: -1; }
}
@media (max-width: 760px) {
  #filters .filters-toggle { flex-direction: row; white-space: nowrap; padding: 0 14px; gap: 6px; border-radius: 14px; }
  #filters .filters-toggle svg.i { margin: 0; }
  .search-go .input { padding-left: 38px; }
  .page-head .btn-row .btn { min-height: 42px; padding: 0 12px; font-size: 13.5px; }
}
.q-card .flex.between > a { min-width: 0; flex: 1; }
.q-card .flex.between > .badge { flex: none; }
@media (max-width: 760px) {
  .q-card .wa-bubble { max-height: 190px; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); cursor: pointer; }
  .q-card.expanded .wa-bubble { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .q-card .thumb.lg { width: 64px; height: 64px; }
}
@media (max-width: 760px) {
  .q-steps { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .q-steps > * { order: 0 !important; grid-column: span 2 !important; }
  .q-steps > .btn.wa-send { order: -3 !important; grid-column: span 6 !important; }
  .q-steps > .btn.sm:not(.wa-send) { order: -2 !important; grid-column: span 3 !important; }
  .q-steps > .btn, .q-steps > a.btn, .q-steps > form .btn, .q-steps > details > summary { width: 100%; min-height: 40px; justify-content: center; white-space: nowrap; font-size: 12.5px; padding: 0 6px; }
  .q-steps > form.q-sent { grid-column: span 2 !important; }
  .q-steps > details[open] { grid-column: span 6 !important; }
}

/* ---- minerador: ferramentas num grupo segmentado, na mesma linha das ações ---- */
.action-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 0; }
.tool-seg { margin-left: auto; display: inline-flex; align-items: stretch; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.tool-seg a, .tool-seg button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: none; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.tool-seg a:hover, .tool-seg button:hover { background: var(--surface-3); color: var(--text); }
.tool-seg svg.i { color: var(--muted); }
.tool-seg a:hover svg.i, .tool-seg button:hover svg.i { color: var(--accent); }
@media (max-width: 1320px) and (min-width: 761px) { .tool-seg span { display: none; } .tool-seg a, .tool-seg button { padding: 9px 11px; } }
@media (max-width: 760px) {
  .tool-seg { grid-column: 1 / -1; margin-left: 0; width: 100%; justify-content: space-between; }
  .tool-seg a, .tool-seg button { flex: 1; justify-content: center; padding: 10px 6px; font-size: 12.5px; }
}

/* ---- Busca ao vivo volta a ser o destaque verde ---- */
.btn.live { background: linear-gradient(135deg, var(--sage), #b8ef2a) !important; color: var(--sage-ink) !important; border-color: transparent !important; font-weight: 700; box-shadow: 0 8px 22px rgba(214,255,92,.3) !important; }
.btn.live:hover { box-shadow: 0 10px 30px rgba(214,255,92,.45) !important; transform: translateY(-1px); }
.btn.live svg.i { color: var(--sage-ink) !important; }
@media (max-width: 760px) {
  .action-bar { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .action-bar .btn { width: 100%; }
  .action-bar .tool-seg { grid-column: 1 / -1; }
}

/* ===== navegação sem recarregar ===== */
#nav-progress{position:fixed;top:0;left:0;height:3px;width:0;z-index:9999;background:linear-gradient(90deg,var(--accent,#ff3d8b),var(--money,#b6ff3b));box-shadow:0 0 10px rgba(255,61,139,.6);opacity:0;pointer-events:none}
#nav-progress.go{opacity:1;width:78%;transition:width 1.6s cubic-bezier(.1,.7,.2,1)}
#nav-progress.done{opacity:0;width:100%;transition:width .18s ease,opacity .3s ease .15s}
.nav-busy main.content{opacity:.62;transition:opacity .15s ease .12s;pointer-events:none}
.nav-busy{cursor:progress}

/* ===== minerador: painel de controle numa linha só ===== */
.miner-deck { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.deck-main { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.deck-main > form { display: contents; }
.deck-cfg { display: inline-flex; align-items: stretch; gap: 2px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 0 rgba(255,255,255,.03) inset; }
.deck-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: none; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; list-style: none; }
.deck-btn::-webkit-details-marker { display: none; }
.deck-btn svg.i { color: var(--muted); transition: color .15s; }
.deck-btn:hover, .deck-more[open] > .deck-btn { background: var(--surface-3); }
.deck-btn:hover svg.i, .deck-more[open] > .deck-btn svg.i { color: var(--accent); }
.deck-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.deck-chev { width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px,-2px); transition: transform .2s; margin-left: 2px; }
.deck-more[open] .deck-chev { transform: rotate(-135deg) translate(-1px,-1px); }
.deck-more { position: relative; }
.deck-pop { min-width: 300px; padding: 6px; z-index: 40; animation: deck-pop .16s var(--ease-out, ease-out); }
@keyframes deck-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.deck-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; border: none; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; text-decoration: none; }
.deck-item:hover { background: var(--surface-3); }
.deck-item svg.i { margin-top: 2px; color: var(--accent); flex: none; }
.deck-item b { display: block; font-size: 14px; font-weight: 600; }
.deck-item small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
@media (max-width: 1100px) and (min-width: 761px) { .deck-btn { padding: 0 12px; } }
@media (max-width: 760px) {
  .miner-deck { flex-direction: column; align-items: stretch; gap: 10px; }
  .deck-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .deck-main .btn { width: 100%; justify-content: center; padding: 12px 8px; font-size: 13.5px; }
  .deck-cfg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 16px; }
  .deck-btn { justify-content: center; height: 46px; padding: 0 6px; font-size: 13px; gap: 6px; border-radius: 12px; width: 100%; }
  .deck-count { min-width: 20px; height: 20px; font-size: 11px; padding: 0 5px; }
  .deck-chev { display: none; }
  .deck-pop { right: 0; left: auto; min-width: min(300px, calc(100vw - 32px)); }
}
@media (max-width: 1240px) and (min-width: 761px) {
  .deck-cfg { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 18px; }
  .deck-btn { justify-content: center; width: 100%; border-radius: 13px; }
  .deck-more .deck-pop { right: 0; }
}
@media (max-width: 760px) { .deck-main .btn { font-size: 13px; gap: 6px; } }
