/* ============================================================
   SempreVenda — Central de Ajuda (wiki)
   Complementa assets/site.css (tokens: --paper, --ink, --evergreen…)
   ============================================================ */

/* ---------- Shell ---------- */
.wiki-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 48px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* ---------- Sidebar ---------- */
.wiki-side {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}
.side-group {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-300);
  margin: 22px 0 8px;
}
.side-group:first-child { margin-top: 4px; }
.wiki-side a {
  display: block;
  padding: 7px 12px;
  margin: 1px 0;
  border-radius: var(--r-sm);
  color: var(--ink-700);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.35;
}
.wiki-side a:hover { background: var(--mint-soft); color: var(--ink); }
.wiki-side a.active {
  background: var(--evergreen);
  color: #fff;
  font-weight: 500;
}

/* ---------- Content ---------- */
.wiki-main { min-width: 0; max-width: 780px; }
.wiki-main .kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--evergreen);
  margin-bottom: 10px;
}
.wiki-main h1 {
  font-size: clamp(30px, 4.5vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.wiki-main .lead-p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-500);
  margin: 0 0 28px;
}
.wiki-main h2 {
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 52px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}
.wiki-main h3 {
  font-size: 18px;
  margin: 32px 0 8px;
  scroll-margin-top: 96px;
}
.wiki-main p, .wiki-main li {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-700);
}
.wiki-main p { margin: 0 0 14px; }
.wiki-main ul, .wiki-main ol { padding-left: 24px; margin: 0 0 16px; }
.wiki-main li { margin-bottom: 6px; }
.wiki-main a { color: var(--evergreen); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.wiki-main strong { color: var(--ink); font-weight: 600; }

/* Botões e elementos da interface citados no texto */
.ui {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--paper-0);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px 2px;
  white-space: nowrap;
  color: var(--ink);
}
/* Caminho de navegação: Admin → Operação → Delivery */
.path {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--mint-soft);
  border: 1px solid var(--mint);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--pine);
  white-space: nowrap;
}

/* Passo a passo numerado */
.steps { counter-reset: passo; list-style: none; padding-left: 0 !important; margin: 18px 0 24px; }
.steps > li {
  counter-increment: passo;
  position: relative;
  padding: 0 0 18px 46px;
  margin: 0;
}
.steps > li::before {
  content: counter(passo);
  position: absolute;
  left: 0; top: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--evergreen);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.steps > li::after {
  content: '';
  position: absolute;
  left: 13.5px; top: 32px; bottom: 2px;
  width: 1px;
  background: var(--line);
}
.steps > li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; margin-bottom: 2px; }

/* Avisos */
.note, .warn, .tip {
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 18px 0 22px;
  font-size: 14.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
}
.note { background: var(--mint-soft); border-color: var(--mint); }
.warn { background: #FBF3E4; border-color: #EAD9B8; }
.tip  { background: var(--paper-warm); }
.note::before, .warn::before, .tip::before {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.note::before { content: 'Bom saber'; color: var(--evergreen); }
.warn::before { content: 'Atenção'; color: var(--amber); }
.tip::before  { content: 'Dica'; color: var(--ink-500); }

/* ---------- Figuras / screenshots ---------- */
figure.shot {
  margin: 22px 0 30px;
  max-width: 100%;
}
figure.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  background: var(--paper-0);
}
figure.shot figcaption {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 10px;
  line-height: 1.5;
}
.shot-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 22px 0 30px;
}
.shot-row figure.shot { flex: 1 1 240px; max-width: 300px; margin: 0; }
figure.shot.mobile { max-width: 300px; }

/* ---------- Tabelas ---------- */
.wiki-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 14.5px;
}
.wiki-main th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 8px 12px;
  border-bottom: 2px solid var(--line);
}
.wiki-main td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}
.table-scroll { overflow-x: auto; }

/* ---------- Busca ---------- */
.wiki-search {
  position: relative;
  margin: 0 0 34px;
}
.wiki-search input {
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  padding: 13px 44px 13px 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-0);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.wiki-search input:focus {
  outline: 2px solid var(--evergreen);
  outline-offset: -1px;
}
.wiki-search .icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  pointer-events: none;
}
.wiki-search .slash {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-300);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 7px;
  background: var(--paper);
}
.search-results {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--paper-0);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.sel { background: var(--mint-soft); }
.search-results .r-page {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--evergreen);
}
.search-results .r-title { font-weight: 600; color: var(--ink); font-size: 14.5px; margin: 2px 0; }
.search-results .r-snip { font-size: 13px; color: var(--ink-500); line-height: 1.45; }
.search-results .r-empty { padding: 16px; font-size: 14px; color: var(--ink-500); }

/* ---------- Cards da home ---------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin: 24px 0 8px;
}
.role-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper-0);
  padding: 18px;
  text-decoration: none !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.role-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.role-card .rc-emoji { font-size: 24px; }
.role-card h3 { margin: 8px 0 4px !important; font-size: 16.5px; color: var(--ink); }
.role-card p { font-size: 13.5px; color: var(--ink-500); margin: 0; line-height: 1.5; }
.topic-list { columns: 2; gap: 32px; margin: 12px 0 8px; padding-left: 0 !important; list-style: none; }
.topic-list li { break-inside: avoid; margin-bottom: 8px; }

/* Índice interno (página do admin) */
.toc {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-warm);
  padding: 16px 20px;
  margin: 20px 0 8px;
  font-size: 14px;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc a { display: inline-block; margin: 2px 14px 2px 0; }

/* Voltar ao topo / navegação de rodapé */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}

/* ---------- Header ativo ---------- */
.site-header .nav-links a.on { color: var(--evergreen); font-weight: 600; }

/* ---------- Mobile ---------- */
.side-toggle {
  display: none;
  width: 100%;
  margin: 0 0 20px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-0);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
@media (max-width: 900px) {
  .wiki-shell { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
  .wiki-side {
    position: static;
    max-height: none;
    display: none;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 16px 16px;
    margin-bottom: 24px;
    background: var(--paper-0);
  }
  .wiki-side.open { display: block; }
  .side-toggle { display: block; }
  .topic-list { columns: 1; }
  .wiki-search .slash { display: none; }
}
