:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --border: #dfe3ea;
  --text: #202124;
  --muted: #5f6368;
  --primary: #1a73e8;
  --danger: #d93025;
  --ok: #188038;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
}

/* ---- Barra superior ---- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.bar .brand { font-weight: 700; font-size: 1.1rem; color: var(--primary); text-decoration: none; white-space: nowrap; }
.bar .main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---- Navegação por submenus ---- */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 8px 11px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
}
.nav-link:hover { color: var(--primary); background: #f1f6fe; }
.nav-link.is-active { color: var(--primary); background: #e8f0fe; font-weight: 600; }
.caret { font-size: 0.7rem; opacity: .7; }

/* Item de menu com submenu (dropdown por hover/focus) */
.nav-item { position: relative; }
.nav-item .nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
  padding: 6px;
  z-index: 50;
}
.nav-item:hover .nav-sub,
.nav-item:focus-within .nav-sub { display: block; }
.nav-sub .nav-sublink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-sub .nav-sublink:hover { background: #f1f6fe; color: var(--primary); }
.nav-sub .nav-sublink.is-active { background: #e8f0fe; color: var(--primary); font-weight: 600; }
.nav-item.has-active > .nav-link { color: var(--primary); background: #e8f0fe; font-weight: 600; }
.nav-spacer { flex: 1; }
.main-nav .nav-link.danger-link { color: var(--danger); }

main { max-width: 1080px; margin: 22px auto; padding: 0 22px; }

/* ---- Flash ---- */
.flash {
  background: #e8f0fe;
  border: 1px solid var(--primary);
  color: #174ea6;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
}
.flash.error { background: #fce8e6; border-color: var(--danger); color: var(--danger); }

/* ---- Cards de estatísticas ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.card b { display: block; font-size: 1.7rem; color: var(--primary); }
.card span { color: var(--muted); font-size: 0.85rem; }

/* ---- Painéis ---- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 22px;
}
.panel h2 { margin: 0 0 14px; font-size: 1.05rem; }

.muted { color: var(--muted); }
.hint code { background: #f1f3f4; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* ---- Formulários ---- */
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; color: var(--muted); }
.grid-form label.check { flex-direction: row; align-items: center; gap: 8px; }
.grid-form textarea, .grid-form input[type=text], .grid-form input[type=number], .grid-form input[type=password], .grid-form select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.grid-form button, .search-form button {
  align-self: end;
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}
.grid-form button:hover, .search-form button:hover { background: #1558b0; }
.grid-form button.danger-btn { background: var(--danger); }
.grid-form button.danger-btn:hover { background: #b3261e; }
@media (max-width: 720px) { .grid-form { grid-template-columns: 1fr; } }

.search-form { display: flex; gap: 8px; margin-bottom: 14px; }
.search-form input[type=text] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.95rem;
  min-width: 0;
}
.search-form-rows .sf-row-1 {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(200px, auto) auto auto;
  gap: 10px;
  align-items: stretch;
}
.search-form-rows select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.95rem;
  background: #fff;
  min-width: 180px;
  height: 42px;
  display: block;
  width: 100%;
  max-width: 100%;
}
.search-form-rows input[type=text] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.95rem;
  height: 42px;
}
.search-form-rows button[type=submit] {
  height: 42px;
}
.search-form-rows .btn-mini {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  box-sizing: border-box;
}
.search-form-rows .btn-mini {
  align-self: center;
}
.sf-resume { line-height: 2.1; }
.sf-resume .chip {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 6px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  border-radius: 999px;
  font-size: 0.82rem;
}
@media (max-width: 860px) {
  .search-form-rows .sf-row-1 { grid-template-columns: 1fr; }
  .sf-resume { line-height: 1.6; }
}

/* ---- Status pills (páginas) ---- */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}
.status-pill-active   { background: #e6f4ea; color: #137333; border-color: #ace0c1; }
.status-pill-paused   { background: #fef7e0; color: #b06000; border-color: #f9d77b; }
.status-pill-disabled { background: #fce8e6; color: #a50e0e; border-color: #f5b5b0; }

/* ---- Bulk bar (ações em massa) ---- */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 14px;
}
.bulk-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: #0f172a; }
.bulk-check input[type=checkbox] { width: 16px; height: 16px; }
.bulk-count { font-size: 0.85rem; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Botões mini variantes (cores semânticas) ---- */
.btn-mini-ok {
  background: #e6f4ea;
  color: #137333;
  border-color: #ace0c1;
}
.btn-mini-ok:hover:not(:disabled) { background: #d7ecd9; }
.btn-mini-warn {
  background: #fef7e0;
  color: #b06000;
  border-color: #f9d77b;
}
.btn-mini-warn:hover:not(:disabled) { background: #fdecc2; }
.btn-mini-danger {
  background: #fce8e6;
  color: #a50e0e;
  border-color: #f5b5b0;
}
.btn-mini-danger:hover:not(:disabled) { background: #fad7d3; }
.btn-mini:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* ---- Tabela admin de páginas ---- */
.admin-pages-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-pages-table thead th {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #f8fafc;
}
.admin-pages-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-pages-table tbody tr:hover td { background: #fafbff; }
.admin-pages-table input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

.actions-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.actions-stack form { display: inline-flex; margin: 0; }
.actions-stack .btn-mini { margin: 0; }

/* ---- Tabelas ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.td-url { word-break: break-all; max-width: 340px; }
.td-url a { color: var(--primary); text-decoration: none; }
.td-url a:hover { text-decoration: underline; }
.t-name small { color: var(--muted); }
.error { color: var(--danger); }

/* ---- Paginação ---- */
.pag-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pag-info { margin: 0; font-size: 0.82rem; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.pagination a, .pagination .current {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; text-decoration: none;
  font-size: 0.9rem; color: var(--primary);
}
.pagination a:hover { background: #f1f6fe; }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination a.pag-arrow { min-width: 30px; padding: 0; font-size: 1rem; }
.pagination .current + .pag-ellipsis { border: none; }
.pag-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 34px; color: var(--muted); }

/* ---- Itens por página (seletor dropdown no rodapé da paginação) ---- */
.pag-wrap-with-perpage {
  justify-content: flex-start;
}
.pag-wrap-with-perpage .pagination {
  margin: 0 auto;
  order: 0;
}
.per-page-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.per-page-form-inline {
  margin-left: 0;
}
.per-page-form-top {
  margin: 0 0 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
}
.per-page-form-top .per-page-label { color: #475569; }
@media (max-width: 760px) {
  .per-page-form-top { justify-content: space-between; }
}
.per-page-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.per-page-form select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.85rem;
  background: #fff;
  color: #0f172a;
  min-width: 70px;
  cursor: pointer;
}
.per-page-form select:hover {
  border-color: #cbd5e1;
}
.per-page-form select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.per-page-form .btn-mini {
  padding: 4px 10px;
  font-size: 0.78rem;
}
@media (max-width: 760px) {
  .pag-wrap-with-perpage { flex-direction: column; align-items: stretch; }
  .pag-wrap-with-perpage .pag-info { order: 0; }
  .pag-wrap-with-perpage .pagination { order: 1; margin: 0; justify-content: flex-start; }
  .per-page-form { order: 2; margin-left: 0; justify-content: space-between; }
}

/* ---- Badges e barras ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.st-pending { background: #fef7e0; color: #b06000; }
.st-running { background: #e8f0fe; color: #174ea6; }
.st-completed { background: #e6f4ea; color: var(--ok); }
.st-failed { background: #fce8e6; color: var(--danger); }
.st-cancelled { background: #f1f3f4; color: var(--muted); }
.st-blocked { background: #fce8e6; color: var(--danger); }
.st-ok { background: #e6f4ea; color: var(--ok); }
.st-danger { background: #fce8e6; color: var(--danger); }
.st-muted { background: #f1f3f4; color: var(--muted); }
.st-news { background: #e8f0fe; color: #1a73e8; border: 1px solid #d2e3fc; }
.st-approved { background: #e6f4ea; color: #137333; }
.st-rejected { background: #fce8e6; color: #c5221f; }
.st-paused { background: #fef7e0; color: #b06000; }
.st-none { background: #f1f3f4; color: #5f6368; }

/* ---- Aviso e auditoria de revisões ---- */
.notice {
  background: #e8f0fe; border: 1px solid #b6cdf5; color: #174ea6;
  border-radius: 8px; padding: 12px 14px; font-size: 0.9rem; margin: 0 0 16px;
}
.review-answers { margin: 0; padding-left: 18px; font-size: 0.85rem; color: var(--muted); }
.review-answers li { margin-bottom: 3px; }

/* ---- Dicionário censurado ---- */
.cat-title { margin: 18px 0 6px; color: var(--muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.4px; }
.word-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.word-list li { display: flex; align-items: center; gap: 8px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 0.9rem; }
.inline-form { display: inline; margin: 0; }

.pbar { background: #eef1f5; border-radius: 6px; height: 8px; width: 140px; overflow: hidden; }
.fill { height: 100%; background: var(--primary); }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-mini { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 0.8rem; cursor: pointer; color: var(--primary); }
.btn-mini:hover { background: #f1f6fe; }
.btn-mini.danger, .danger { color: var(--danger); border-color: #f5c6c2; }
.btn-mini.danger:hover { background: #fce8e6; }

/* ---- Login ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { font-size: 1.3rem; margin: 0; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; color: var(--muted); }
.login-card input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.95rem;
}
.login-card button {
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}

/* ---- Drawer lateral (estatísticas do negócio) ---- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}
.drawer.is-open { pointer-events: auto; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 100%);
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 36px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fbff 0%, #eef2ff 100%);
}
.drawer-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}
.drawer-title {
  font-size: 1.2rem;
  margin: 0 0 2px;
  color: #0f172a;
  line-height: 1.25;
}
.drawer-sub {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 380px;
}
.drawer-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.drawer-close:hover { background: #f1f5f9; }
.drawer-loading {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.drawer-body {
  padding: 22px 24px 32px;
  overflow-y: auto;
  flex: 1;
}
/* ---- Tabela admin de negócios (linha principal + linha de métricas) ---- */
.biz-admin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.biz-admin-table thead th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #f8fafc;
}
.biz-admin-table thead th:first-child { border-top-left-radius: 10px; }
.biz-admin-table thead th:last-child { border-top-right-radius: 10px; }
.biz-admin-table .biz-row-main td {
  padding: 14px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  background: #fff;
}
.biz-admin-table .biz-row-main .biz-id { font-weight: 600; color: #334155; }
.biz-admin-table .biz-cat,
.biz-admin-table .biz-city { color: #334155; }
.biz-admin-table .biz-actions { white-space: nowrap; }
.biz-admin-table .biz-row-meta td {
  padding: 0 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
/* ---- Botão toggle (expandir/colapsar métricas na linha) ---- */
.biz-admin-table .biz-toggle-cell {
  padding: 14px 4px 14px 10px;
}
.biz-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.2s ease;
}
.biz-toggle:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #cbd5e1;
}
.biz-toggle-icon {
  font-size: 0.72rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}
.biz-row-main:has(+ .biz-row-meta.is-open) .biz-toggle-icon,
.biz-toggle[aria-expanded="true"] .biz-toggle-icon {
  transform: rotate(90deg);
}

.biz-row-meta {
  display: none;
}
.biz-row-meta.is-open {
  display: table-row;
  animation: bizMetaFadeIn 0.2s ease-out;
}
@keyframes bizMetaFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.biz-admin-table .biz-row-meta > td {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.biz-admin-table .biz-row-main td {
  border-bottom: none;
}
.biz-admin-table tbody:has(.biz-row-meta.is-open + .biz-row-main) tr.biz-row-main + tr.biz-row-meta td,
.biz-admin-table .biz-row-meta.is-open + tr.biz-row-main td {
  border-top: 1px solid #e2e8f0;
}

.biz-meta-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px 0 82px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.biz-meta-list > li {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.biz-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--muted);
}
.biz-meta-value {
  font-size: 1rem;
  color: #0f172a;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.biz-meta-value.biz-ctr { color: var(--primary); }
.biz-meta-foot {
  font-size: 0.72rem;
  color: #64748b;
}

@media (max-width: 1180px) { .biz-meta-list { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 70px; } }
@media (max-width: 780px) {
  .biz-meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 62px; }
  .biz-admin-table thead th:nth-child(3), .biz-admin-table thead th:nth-child(4),
  .biz-admin-table .biz-cat, .biz-admin-table .biz-city { display: none; }
}

/* ---- Tabela KPI no drawer lateral (métricas em linhas) ---- */
.kpi-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.9rem;
}
.kpi-table thead th {
  text-align: left;
  padding: 11px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.kpi-table .kpi-align { text-align: right; font-variant-numeric: tabular-nums; }
.kpi-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.kpi-table tbody tr:last-child td { border-bottom: none; }
.kpi-table tbody tr:hover td { background: #fafbff; }
.kpi-metric {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
  color: #0f172a;
}
.kpi-metric small {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--muted);
}
.kpi-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}
.kpi-dot-imp { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.kpi-dot-click { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.12); }
.kpi-dot-view { background: #a855f7; box-shadow: 0 0 0 3px rgba(168,85,247,0.12); }
.kpi-dot-ctr { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }
.kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}
.kpi-ctr-row td { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.kpi-ctr-row:hover td { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; }
.kpi-ctr-value { color: #b45309; }

/* (classes antigas removidas do uso, mantidas por segurança se houver referências) */
.drawer-cards { display: none; }
.drawer-card { display: none; }
.d-label, .d-value, .d-foot { display: none; }

.drawer-section { margin-bottom: 24px; }
.drawer-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: #0f172a;
}
.drawer-section-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.drawer-empty {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 22px 18px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.terms-chart {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 22px;
}
.term-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
}
.term-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.term-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.term-word {
  font-size: 0.86rem;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-bar-wrap {
  background: #f1f5f9;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}
.term-bar {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #22c55e 100%);
  border-radius: 999px;
  min-width: 3px;
  transition: width 0.3s ease;
}
.term-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.terms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
.terms-table th,
.terms-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.terms-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
}
.term-td-count {
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.term-td-date { color: var(--muted); }

@media (max-width: 520px) {
  .drawer-cards { grid-template-columns: 1fr; }
  .term-row { grid-template-columns: 120px minmax(0, 1fr) 60px; }
}