/* Dashboard de catálogo: barra marinho fixa, resumo em números, abas e cards por categoria */
:root {
  --navy: #1F2044;
  --navy-2: #2A2C5A;
  --blue: #1D5297;
  --sky: #2E93EE;
  --sky-soft: #E6F1FD;
  --yellow: #FFCF00;
  --orange: #F67922;
  --bg: #F2F5FA;
  --surface: #FFFFFF;
  --line: #DCE3EE;
  --text: #1F2044;
  --muted: #5E6886;
  --green: #138A52;
  --green-soft: #E3F5EC;
  --amber: #A05A00;
  --amber-soft: #FFF3D1;
  --red: #B42B22;
  --red-soft: #FCE7E5;
  --violet: #5B3FB8;
  --violet-soft: #EEE9FB;
  --font: 'Galano Grotesque', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- topo ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; box-shadow: 0 2px 12px rgba(31,32,68,.25); }
.top__inner { max-width: 1320px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand__logo { height: 26px; display: block; }
.brand__name { font-weight: 500; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.25); white-space: nowrap; }
.top__right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.updated { font-size: 13px; color: #B9C7E6; font-variant-numeric: tabular-nums; }
.updated strong { color: #fff; font-weight: 500; }

.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; line-height: 1; white-space: nowrap; transition: background .15s, opacity .15s; }
.btn--yellow { background: var(--yellow); color: var(--navy); }
.btn--yellow:hover { background: #FFDB3D; }
.btn--yellow:disabled { opacity: .7; cursor: progress; }
.btn--yellow:disabled svg { animation: spin 1s linear infinite; }
.btn--ghost { background: var(--surface); color: var(--blue); border: 1px solid var(--line); font-weight: 500; }
.btn--ghost:hover { border-color: var(--sky); }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { max-width: 1320px; margin: 0 auto; padding: 0 20px 12px; display: grid; gap: 6px; }
.progress__bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 6px; transition: width .4s; }
.progress__text { font-size: 13px; color: #CFDAF2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- conteúdo ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; }

.campaign { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 14px; padding: 14px 18px; position: relative; overflow: hidden; }
.campaign::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; border: 14px solid var(--blue); opacity: .6; }
.campaign__label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); }
.campaign__pill { background: var(--yellow); color: var(--navy); font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 99px; }
.campaign__text { color: #CFDAF2; font-size: 14px; position: relative; z-index: 1; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--sky); transform: translateY(-1px); }
.kpi__value { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { font-size: 13px; color: var(--muted); }
.kpi--main { background: var(--blue); border-color: var(--blue); color: #fff; }
.kpi--main .kpi__label { color: #CFE2F9; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px 10px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.is-active { color: var(--navy); border-bottom-color: var(--yellow); }
.tab__count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.tab__count:empty { display: none; }
.panel { display: none; flex-direction: column; gap: 18px; }
.panel.is-active { display: flex; }
.panel__intro { margin: 0; color: var(--muted); max-width: 75ch; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); min-width: 0; }
.search:focus-within { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-soft); }
.search input { border: 0; outline: 0; background: none; padding: 10px 0; width: 100%; min-width: 0; color: var(--text); }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-width: 100%; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.is-on b { color: var(--yellow); }

/* ---------- categorias e produtos ---------- */
.cat { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 90px; }
.cat + .cat { margin-top: 18px; }
.cat__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--navy); padding-bottom: 8px; }
.cat__title { margin: 0; font-size: 21px; line-height: 1.2; }
.cat__count { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.cat__desc { margin: 0; color: var(--muted); font-size: 14px; max-width: 90ch; }
.cat__link { font-size: 13px; font-weight: 500; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card--dim { background: #FAFBFD; }
.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card__name { margin: 0; font-size: 17px; line-height: 1.25; }
.card__alt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card__id { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.card__desc { margin: 0; font-size: 14px; color: #3B4466; }

.pill { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill--vitrine { background: var(--green-soft); color: var(--green); }
.pill--tabela { background: var(--amber-soft); color: var(--amber); }
.pill--complemento { background: var(--violet-soft); color: var(--violet); }
.pill--oculto { background: var(--red-soft); color: var(--red); }
.pill--parceiro { background: var(--sky-soft); color: var(--blue); }

.price { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.price__row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price__value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price__suffix { font-size: 13px; color: var(--muted); }
.price__off { background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.price__meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.price__meta s { color: #8A93AE; }
.check { font-size: 12px; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; }
.check--ok { color: var(--green); }
.check--no { color: var(--amber); }

.note { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--amber-soft); color: #6B4300; }
.note--info { background: var(--sky-soft); color: var(--blue); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--navy); color: var(--yellow); padding: 1px 6px; border-radius: 4px; }

details { border-top: 1px solid var(--line); padding-top: 8px; }
details summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--blue); list-style: none; display: flex; justify-content: space-between; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-weight: 700; }
details[open] summary::after { content: "–"; }
.feats { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.feats li { padding-left: 18px; position: relative; }
.feats li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: inset 0 0 0 2px var(--orange); }
.feats li.no { color: #98A0B8; text-decoration: line-through; }
.feats li.no::before { background: var(--line); box-shadow: none; }
.feats li.h { padding-left: 0; font-weight: 700; margin-top: 4px; }
.feats li.h::before { display: none; }
.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.mini th, .mini td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mini th { color: var(--muted); font-weight: 500; }
.mini td:not(:first-child), .mini th:not(:first-child) { text-align: right; }
.links { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.links a { text-decoration: none; background: var(--sky-soft); padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 4px; }
.links a:hover { background: #D5E7FC; }

/* ---------- apps ---------- */
.group__title { margin: 6px 0 0; font-size: 18px; }
.app { flex-direction: row; gap: 14px; align-items: flex-start; }
.app__logo { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; overflow: hidden; font-weight: 700; color: var(--blue); font-size: 18px; }
.app__logo img { max-width: 36px; max-height: 36px; }
.app__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.app__name { margin: 0; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--yellow); color: var(--navy); }
.tag--src { background: var(--bg); color: var(--muted); font-weight: 500; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { position: sticky; top: 0; background: #F7F9FC; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; white-space: nowrap; cursor: pointer; user-select: none; }
.table th[data-num], .table td.num { text-align: right; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #F7FAFF; }
.tld { font-weight: 700; color: var(--navy); }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- mudanças ---------- */
.change { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.change + .change { margin-top: 8px; }
.change__type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; }
.t-novo { background: var(--green-soft); color: var(--green); }
.t-removido { background: var(--red-soft); color: var(--red); }
.t-preço { background: var(--amber-soft); color: var(--amber); }
.t-status { background: var(--violet-soft); color: var(--violet); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty img { width: 180px; }
.empty h2 { color: var(--navy); margin: 10px 0 4px; }
.none { padding: 30px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 12px; border: 1px dashed var(--line); }

.foot { max-width: 1320px; margin: 0 auto; padding: 0 20px 30px; font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .top { position: static; }
  .wrap { padding: 16px 16px 32px; }
  .top__inner { padding: 10px 16px; }
  .brand__name { display: none; }
  .updated { width: 100%; order: 2; }
  .kpi__value { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
