/* BREAKPOINTS
   SM  — max  767px  (mobile)
   MD  — 768px–1023px (tablet)
   LG  — 1024px+     (desktop)
*/

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input, button, select, textarea { font-family: inherit; }

:root {
  --bg:        #111924;
  --surface:   #0c101a;
  --card:      #1a1a2e;
  --card-hover:#1f1f38;
  --border:    #2a2a45;
  --accent:    #7c3aed;
  --accent-lt: #9f67ff;
  --accent-dim:#3b1d6e;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --dim:       #94a3b8;
  --success:   #10b981;
  --warn:      #f59e0b;
  --danger:    #ef4444;
  --google:    #4285f4;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

html, body { height: 100%; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Tema claro ──────────────────────────────────────────────────────────────── */
body.light {
  --bg:        #f0f4f8;
  --surface:   #e2e8f0;
  --card:      #ffffff;
  --card-hover:#f1f5f9;
  --border:    #cbd5e1;
  --text:      #1e293b;
  --muted:     #94a3b8;
  --dim:       #64748b;
  --accent:    #6d22e0;
  --accent-lt: #7c3aed;
  --accent-dim:#ede9fe;
}
body.light #screen-login {
  background: linear-gradient(225deg, #dbe8f5 0%, #f0f4f8 45%, #e2e8f0 100%);
}
body.light .login-wrap {
  background: rgba(255,255,255,.75);
}
body.light .sidebar {
  background: linear-gradient(to top, #e2eaf5 0%, #f5f8fc 60%);
}
body.light .nav-item         { color: #475569; }
body.light .nav-item:hover   { background: #dde6f0; color: #1e293b; }
body.light .nav-item.active  { background: var(--accent); color: #fff; }
body.light .nav-section      { color: #94a3b8; }
body.light .sidebar-version  { color: #94a3b8; }
body.light .sidebar-user-avatar { box-shadow: 0 0 0 3px #f0f4f8; }
body.light .main {
  background: linear-gradient(225deg, #dbe8f5 0%, #f0f4f8 45%, #e2e8f0 100%);
}
body.light .header-actions.scrolled {
  background: linear-gradient(135deg, rgba(219,232,245,.9) 0%, rgba(240,244,248,.9) 55%, rgba(226,232,240,.9) 100%);
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
}
body.light input[type="text"],
body.light input[type="password"],
body.light input[type="email"],
body.light input[type="url"],
body.light select { background: #f1f5f9; color: var(--text); }
body.light .user-edit-form { background: #ffffff; }
/* -- Dashboard cards -- */
body.light .ga-card       { background: rgba(255,255,255,.85); }
body.light .card          { background: #ffffff; }
body.light .modal-overlay,
body.light .hist-modal-overlay { background: rgba(0,0,0,.35); }
body.light .detail-modal,
body.light .prop-modal    { background: #f8fafc; }
/* -- Buttons / tabs -- */
body.light .btn-outline   { background: #e2e8f0; color: var(--dim); }
body.light .btn-google    { background: #e2e8f0; color: #2563eb; }
body.light .type-tab                  { background: #e2e8f0; color: var(--dim); }
body.light .type-tab.active           { background: var(--accent); color: #fff; }
body.light .type-tab:hover:not(.active) { background: #d1dae6; color: var(--text); }
body.light .select-sm                 { background-color: #e2e8f0; color: var(--text); }
body.light .select-sm option          { background: #f1f5f9; color: var(--text); }
body.light .select-sm:hover           { color: var(--text); }
/* -- Settings -- */
body.light .settings-section { background: rgba(255,255,255,.7); }
body.light .seo-rpt-row       { background: rgba(0,0,0,.02); }
body.light .seo-rpt-item      { background: rgba(0,0,0,.02); }
body.light .seo-rpt-item:hover { background: rgba(0,0,0,.05); }
body.light .seo-rpt-group-block,
body.light .seo-rpt-gen-block { background: rgba(0,0,0,.03); }
body.light .seo-rpt-select    { background: var(--surface); }
body.light .seo-rpt-select option { background: #f1f5f9; }
body.light .seo-rpt-manual-section { border-top-color: rgba(0,0,0,.08); }
/* -- BusqueMeSEO -- */
body.light .res-card,
body.light .bseo-hist-item { background: rgba(255,255,255,.8); }
body.light .bseo-completude-bar,
body.light .bseo-ps-metric-bar,
body.light .res-ps-mini-bar,
body.light .res-cwv-bar    { background: rgba(0,0,0,.08); }
body.light .bseo-rank-ias  { background: rgba(0,0,0,.06); }
body.light .bseo-url-input,
body.light select.bseo-url-input { background: #ffffff; border-color: var(--border); }
body.light input[type="month"].bseo-url-input { background-color: #ffffff; border-color: var(--border); }
body.light select.bseo-url-input option { background: #ffffff; }
/* -- DataStudio -- */
body.light .ds-card        { background: rgba(255,255,255,.85); }
body.light .ds-kpi         { background: rgba(0,0,0,.04); }
body.light .ds-table th    { border-bottom-color: #cbd5e1; }
body.light .ds-table td    { border-bottom-color: rgba(0,0,0,.06); color: var(--text); }
body.light .ds-table tr:hover td { background: rgba(0,0,0,.02); }
/* -- Backlinks sidebar -- */
body.light .bl-sidebar,
body.light .bl-clients-sidebar  { background: #eaf0f8; }
body.light .bl-client-item:hover { background: rgba(0,0,0,.04); }
body.light .bl-client-item-count { background: rgba(0,0,0,.06); }
body.light .bl-filter-sel        { background: rgba(203,213,225,.6); color: var(--dim); }
/* -- Backlinks grid -- */
body.light .bl-grid-inner        { background: rgba(255,255,255,.5); }
body.light .bl-ghdr              { background: rgba(240,244,248,.97); border-bottom-color: rgba(0,0,0,.07); }
body.light .bl-row-even          { background: rgba(0,0,0,.018); }
body.light .bl-gdata:not(.bl-row-even) { background: rgba(0,0,0,.003); }
body.light .bl-row-hover         { background: rgba(124,58,237,.06) !important; }
body.light .bl-row-detail        { background: rgba(124,58,237,.03); border-top-color: rgba(0,0,0,.06); }
body.light .bl-row-check,
body.light #bl-check-all,
body.light .hist-cb              { background: #e2e8f0; }
body.light .hist-cb:checked      { background: rgba(16,185,129,.2); }
/* -- Scrollbars -- */
body.light .bl-month-block::-webkit-scrollbar-thumb        { background: rgba(0,0,0,.18); }
body.light .bl-month-block::-webkit-scrollbar-thumb:hover  { background: rgba(0,0,0,.32); }
body.light ::-webkit-scrollbar-thumb                       { background: #b0bec9; }
body.light ::-webkit-scrollbar-thumb:hover                 { background: #8fa0b0; }
/* -- Ícones vazios da tabela de backlinks -- */
body.light .bl-icon-empty,
body.light .bl-cell-empty-obs,
body.light .bl-cell-empty-link,
body.light .bl-resp-avatar.bl-resp-emoji { color: #64748b; opacity: .7; }
body.light .bl-cell-editable:hover .bl-icon-empty,
body.light .bl-cell-editable:hover .bl-cell-empty-obs,
body.light .bl-cell-link-col:hover .bl-cell-empty-link,
body.light .bl-gdata:hover .bl-resp-avatar.bl-resp-emoji { color: var(--accent); opacity: 1; }
body.light .bl-link-ico { color: #64748b; }
body.light .bl-gc-cliente,
body.light .bl-gc-mes,
body.light .bl-gc-obs,
body.light .bl-gc-data  { color: #475569; }
body.light .bl-gc-obsi  { color: #64748b; }
/* -- Misc -- */
body.light .sidebar-tooltip { background: #e2e8f0; color: #1e293b; border-left-color: var(--accent); }
/* -- Popups / modais -- */
body.light .bseo-hist-type-pop,
body.light .bl-dropdown,
body.light .bl-hist-popover     { background: #ffffff; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
body.light .bl-hist-pop-entry   { border-top-color: rgba(0,0,0,.07); }
body.light .hist-modal-panel    { background: #f8fafc; }
body.light .hist-modal-close    { background: rgba(0,0,0,.06); }
body.light .hist-modal-close:hover { background: rgba(239,68,68,.12); }
body.light .bl-opts-box         { background: #ffffff; border-color: rgba(0,0,0,.1); box-shadow: 0 20px 60px rgba(0,0,0,.15); }
body.light .bl-opts-header,
body.light .bl-opts-footer      { border-color: rgba(0,0,0,.08); }
body.light .bl-opts-label       { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.12); }
body.light .bl-opts-add-btn     { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.15); }
body.light .bl-opts-cancel      { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); }
body.light .bl-opts-cancel:hover { background: rgba(0,0,0,.09); }
body.light .bl-opts-color       { border-color: rgba(0,0,0,.15); }
body.light .bl-dropdown-opt:hover { background: rgba(0,0,0,.05); }
body.light .modal-table tr:hover td,
body.light .fetch-prop-item:hover { background: rgba(0,0,0,.03); }
/* ─────────────────────────────────────────────────────────────────────────── */

a { color: var(--accent-lt); text-decoration: none; }
a:hover { text-decoration: none; }

/* UTILITY */
.hidden { display: none !important; }
.screen { display: none; width: 100%; min-height: 100vh; }
.screen.active { display: flex; }
#screen-app { height: 100vh; overflow: hidden; }

/* LOGO */
.logo-img { object-fit: contain; display: block; }
.login-logo-img { width: auto; height: 72px; margin: 0 auto 32px; }
.sidebar-logo-img{ width: auto; height: 48px; }
.sidebar-logo-full { display: block; max-width: 123px; height: auto; }
.sidebar-logo-sm   { display: none; width: 48px; height: auto; }

/* ── LOGIN — split layout ───────────────────────────────────────────────────── */
#screen-login { padding: 0; align-items: stretch; }

.login-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%; min-height: 100vh;
}

/* Painel esquerdo */
.login-panel-left {
  background: #080a0e;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
  position: relative; overflow: hidden;
  animation: lpSlideLeft .7s ease-out both;
}
.login-panel-left::before {
  content: ''; position: absolute;
  width: 380px; height: 380px;
  background: radial-gradient(circle at 30% 30%, rgba(124,58,237,.18) 0%, transparent 70%);
  border-radius: 50%; top: -60px; left: -60px; filter: blur(50px);
}
.login-panel-left::after {
  content: ''; position: absolute;
  width: 280px; height: 280px;
  background: radial-gradient(circle at 70% 70%, rgba(124,58,237,.1) 0%, transparent 70%);
  border-radius: 50%; bottom: -40px; right: -40px; filter: blur(55px);
}

/* Decorativos */
.lp-deco { position: absolute; opacity: .12; pointer-events: none; }
.lp-deco-rings {
  width: 160px; height: 210px; top: 36px; left: 28px;
  border: 2px solid rgba(255,255,255,.5); border-radius: 50%; transform: rotate(-30deg);
}
.lp-deco-rings::before {
  content: ''; position: absolute;
  width: 110px; height: 150px; top: 22px; left: 22px;
  border: 2px solid rgba(255,255,255,.35); border-radius: 50%; transform: rotate(20deg);
}
.lp-deco-dots {
  top: 70px; right: 50px;
  display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; opacity: .25;
}
.lp-deco-dots span {
  display: block; width: 5px; height: 5px;
  background: rgba(255,255,255,.7); border-radius: 50%;
}
.lp-deco-circle {
  width: 90px; height: 90px; bottom: 110px; left: 55px;
  border: 2px solid rgba(255,255,255,.4); border-radius: 50%;
}
.lp-deco-plus {
  font-size: 30px; color: rgba(255,255,255,.5);
  bottom: 160px; right: 72px; opacity: .2;
}

.lp-content {
  position: relative; z-index: 2;
  text-align: center; color: #fff;
}
.lp-logo { width: 200px; height: auto; margin: 0 auto 32px; display: block; }
.lp-content h2 {
  font-size: 34px; font-weight: 800; line-height: 1.2; margin-bottom: 14px;
}
.lp-content p {
  font-size: 15px; color: rgba(255,255,255,.75);
  max-width: 290px; line-height: 1.65; margin: 0 auto;
}

/* Painel direito */
.login-panel-right {
  background: #080a0e;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
  animation: lpSlideRight .7s ease-out .1s both;
}

.login-form-wrap { width: 100%; max-width: 380px; }

.login-form-header { margin-bottom: 32px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 0; }
.login-brand-logo { height: 36px; width: auto; margin-bottom: 18px; }
.login-form-header h1 { font-size: 26px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.login-form-header p  { font-size: 13px; color: var(--muted); margin: 0; }
.login-form-header p  { font-size: 13px; color: var(--muted); }

.login-field { margin-bottom: 18px; }
.login-field label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px;
}
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; flex-shrink: 0; z-index: 1;
  width: 16px; height: 16px;
}
.login-input-wrap input[type] {
  width: 100%; padding: 12px 14px 12px 36px; box-sizing: border-box;
  background: #161b26; color: var(--text);
  border: none; border-radius: 8px; outline: none;
  font-family: 'Manrope', sans-serif; font-size: 14px;
  transition: background .2s, box-shadow .2s;
}
.login-input-wrap input:focus {
  background: #0d1117;
  box-shadow: 0 0 0 3px rgba(124,58,237,.25);
}
.login-input-wrap input::placeholder { color: #4a5568; }

.recaptcha-wrap { margin: 14px 0; display: flex; justify-content: center; min-height: 0; }

.btn-login {
  width: 100%; padding: 13px 24px; margin-top: 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: none; border-radius: 8px; color: #fff;
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .2s, opacity .2s;
}
.btn-login:hover   { transform: translateY(-2px); }
.btn-login:active  { transform: translateY(0); }
.btn-login-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: loginSpin .6s linear infinite; display: none;
}
.btn-login.loading .btn-login-spinner { display: inline-block; }
.btn-login.loading .btn-login-text    { display: none; }

.login-footer {
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--muted); text-align: center;
}

/* Animações */
@keyframes lpSlideLeft  { from { opacity:0; transform:translateX(-30px); } to { opacity:1; transform:translateX(0); } }
@keyframes lpSlideRight { from { opacity:0; transform:translateX(30px);  } to { opacity:1; transform:translateX(0); } }
@keyframes loginSpin    { to { transform: rotate(360deg); } }

/* Tema claro — login */
body.light .login-panel-left,
body.light .login-panel-right { background: #080a0e; }
body.light .login-form-header h1 { color: #e2e8f0; }
body.light .login-form-header p  { color: rgba(255,255,255,.5); }
body.light .login-field label     { color: rgba(255,255,255,.4); }
body.light .login-input-wrap input { background: #161b26; color: #e2e8f0; }
body.light .login-input-wrap input:focus { background: #0d1117; }
body.light .login-input-wrap input::placeholder { color: #4a5568; }
body.light .login-input-icon { color: rgba(255,255,255,.4); }

/* Responsive */
@media (max-width: 768px) {
  .login-container { grid-template-columns: 1fr; }
  .login-panel-left { padding: 48px 32px; min-height: 260px; }
  .lp-content h2 { font-size: 26px; }
  .login-panel-right { padding: 48px 32px; }
}
@media (max-width: 480px) {
  .login-panel-left  { padding: 36px 24px; min-height: 220px; }
  .login-panel-right { padding: 36px 24px; }
  .lp-content h2 { font-size: 22px; }
}
/* ─────────────────────────────────────────────────────────────────────────── */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  outline: none;
}

.input-color {
  width: 48px;
  height: 38px;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 8px;
  background: var(--bg);
  border: none;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(239,68,68,.1);
  border-radius: 8px;
  margin-bottom: 14px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .18s;
  white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-lt); }
.btn-outline { background: #1a2438; color: var(--dim); }
.btn-outline:hover { background: #1e2a42; color: var(--text); }
.btn-google { background: #1a2438; color: #60a5fa; }
.btn-google:hover { background: #1e2a42; color: #93c5fd; }
.btn-danger { background: rgba(239,68,68,.08); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.15); }
.btn-success { background: rgba(16,185,129,.15); color: #34d399; }
.btn-success:hover { background: rgba(16,185,129,.25); }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 11px; font-weight: 700; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#btn-refresh { padding: 0 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* APP LAYOUT */
#screen-app { flex-direction: row; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(to top, #1a2438 0%, #0c101a 60%);
  display: flex;
  flex-direction: column;
  padding: 24px 0 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-radius: 0 12px 12px 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 20px 24px;
  margin-bottom: 12px;
  gap: 4px;
}
.sidebar-brand-link { display: contents; }
.sidebar-version {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.sidebar.collapsed .sidebar-brand { align-items: center; }
.sidebar.collapsed .sidebar-version { font-size: 9px; text-align: center; width: 100%; }

.sidebar-nav { flex: 1; padding: 0 10px; display: flex; flex-direction: column; justify-content: center; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--card); color: var(--text); text-decoration: none; }
.nav-item:focus, .nav-item:focus-visible { outline: none; }
.nav-item.active { background: var(--accent-dim); color: var(--accent-lt); }
.nav-section { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; padding: 16px 16px 4px; }
.nav-sub { padding-left: 32px; }

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  margin-left: auto;
  flex-shrink: 0;
  transition: color .15s;
  overflow: hidden;
  max-width: 28px;
  opacity: 1;
  transition: color .15s, max-width 0.25s ease, opacity 0.15s ease;
}
.sidebar-logout svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar-logout:hover { color: var(--danger); }
.sidebar.collapsed .sidebar-logout { max-width: 0; opacity: 0; pointer-events: none; }

.main { flex: 1; overflow-y: auto; padding: 0; background: linear-gradient(225deg, #1e3050 0%, #111924 45%, #0c101a 100%); }

.view { display: none; padding: 32px 36px; width: 100%; }
.view.active { display: block; }
.view-backlinks.active { display: flex; padding: 0; height: 100%; overflow: hidden; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.view-header h2 { font-size: 22px; font-weight: 800; }
.view-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: sticky;
  top: 8px;
  z-index: 60;
  width: fit-content;
  margin-left: auto;
  margin-bottom: 20px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .25s, box-shadow .25s;
}
.header-actions.scrolled {
  background: linear-gradient(135deg, rgba(30,48,80,.85) 0%, rgba(17,25,36,.85) 55%, rgba(12,16,26,.85) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.type-filter { display: flex; gap: 4px; }
.type-tab { height: 28px; padding: 0 12px; border-radius: 8px; border: none; background: #1a2438; color: var(--dim); font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap; }
.type-tab.active { background: var(--accent-dim); color: var(--accent-lt); }
.type-tab:hover:not(.active) { background: #1e2a42; color: var(--text); }

.type-badge { font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .3px; }
.type-badge.type-proprio  { background: rgba(16,185,129,.15); color: #34d399; }
.type-badge.type-cliente  { background: rgba(96,165,250,.15); color: #60a5fa; }
.type-badge.type-portais  { background: rgba(251,146,60,.15);  color: #fb923c; }

.select-sm {
  height: 28px;
  padding: 0 28px 0 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  width: auto;
  border-radius: 8px;
  cursor: pointer;
  background-color: #1a2438;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: var(--dim);
  border: none;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: color .15s;
}
.select-sm:focus { outline: none; box-shadow: none; border: none; }
.select-sm option { background: #1a2438; color: var(--dim); border-radius: 8px; }
.select-sm:hover { color: var(--text); }

/* BANNER */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 24px;
}
.banner svg { flex-shrink: 0; margin-top: 1px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.banner-warn { background: rgba(245,158,11,.08); color: #fcd34d; }
.banner-warn svg { stroke: var(--warn); }

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.cards-grid.cols-1 { grid-template-columns: 1fr; }
.cards-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cards-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.ga-card {
  background: #1a1a2e94;
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.ga-card:hover { transform: translateY(-2px); box-shadow: 0 4px 24px rgba(124,58,237,.18); }

/* Hover overlay + botão Mais Detalhes */
.card-hover-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(to bottom, transparent 40%, rgba(124,58,237,.14) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 1;
}
.ga-card:hover .card-hover-overlay { opacity: 1; }
.card-detail-btn {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  padding: 7px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s, transform .2s, background .15s;
}
.ga-card:hover .card-detail-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.card-detail-btn:hover { background: var(--accent-lt); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 860px;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 800; }
.modal-title-row { display: flex; align-items: center; gap: 8px; }
.modal-subtitle { font-size: 11px; color: var(--muted); margin-top: 2px; }
.modal-close {
  width: 28px; height: 28px; border-radius: 7px; border: none;
  background: var(--bg); color: var(--dim); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-box.modal-wide { max-width: 1120px; }
.modal-body.modal-3col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .modal-body.modal-3col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .modal-body, .modal-body.modal-3col { grid-template-columns: 1fr; } }

/* Modal section cards */
.modal-section {
  background: #1a1a2e94;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.modal-section-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-section-icon svg { stroke: var(--accent-lt); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-section-title {
  font-size: 12px; font-weight: 700; color: var(--text);
}
.modal-section-sub {
  font-size: 10px; color: var(--muted); margin-top: 1px;
}
.modal-table { width: 100%; border-collapse: collapse; }
.modal-th-name, .modal-th-val { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; padding: 0 6px 8px; text-align: left; }
.modal-th-val { text-align: right; white-space: nowrap; }
.modal-th-note { font-size: 8px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); opacity: .7; }
.modal-table tr { }
.modal-table tr:last-child { border-bottom: none; }
.modal-table tr:hover td { background: rgba(255,255,255,.03); }
.modal-table td { padding: 7px 6px; font-size: 12px; }
.modal-td-name { color: var(--text); font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-td-val { color: var(--accent-lt); font-weight: 700; text-align: right; white-space: nowrap; }
.modal-rank { color: var(--muted); font-size: 10px; margin-right: 6px; }
.modal-loading { grid-column: 1/-1; text-align: center; padding: 48px; color: var(--muted); font-size: 13px; }
.modal-err { color: var(--danger); font-size: 12px; text-align: center; padding: 20px; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.card-title { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title-wrap { min-width: 0; flex: 1; }
.card-url { font-size: 10px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badge { font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .4px; }
.badge-ok   { background: rgba(16,185,129,.15); color: #34d399; }
.badge-err  { background: rgba(239,68,68,.15);  color: #f87171; }
.badge-load { background: rgba(100,116,139,.15); color: var(--muted); }

.card-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 20, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: var(--radius);
}
body.light .card-loading-overlay { background: rgba(240, 240, 255, 0.72); }

.card-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.metric-item { display: flex; flex-direction: column; }
.metric-label { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.metric-value { font-size: 14px; font-weight: 600; line-height: 1; }
.metric-value.loading { font-size: 12px; color: var(--muted); }
.metric-sub  { font-size: 10px; font-weight: 600; margin-top: 1px; }
.metric-up   { color: var(--success); }
.metric-down { color: var(--danger); }
.metric-delta { display: flex; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; margin-top: 3px; }
.metric-delta svg { flex-shrink: 0; }
.metric-delta.delta-up   { color: var(--success); }
.metric-delta.delta-down { color: var(--danger); }

.card-chart { height: 36px; display: flex; align-items: flex-end; gap: 2px; margin-bottom: 8px; }
.chart-bar { flex: 1; background: var(--accent); opacity: .35; border-radius: 2px 2px 0 0; transition: opacity .2s; min-height: 3px; }
.chart-bar:hover { opacity: .7; }

.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; font-size: 10px; color: var(--muted); }
.card-footer a { color: var(--muted); font-size: 10px; }
.card-footer a:hover { color: var(--accent-lt); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--card-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 80px 36px; color: var(--muted); }
.empty-state svg { stroke: var(--muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--dim); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* CONFIGURAÇÕES */
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.config-card { background: var(--card); border-radius: var(--radius); padding: 24px; }
.config-card-full { grid-column: 1 / -1; }
.config-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.config-card h3 svg { stroke: var(--accent-lt); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.config-desc { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.config-hint { margin-top: 18px; padding: 14px 16px; background: var(--bg); border-radius: 8px; font-size: 12px; color: var(--dim); }
.config-hint strong { color: var(--text); }
.config-hint ol { padding-left: 18px; margin-top: 8px; line-height: 1.8; }
.config-hint em { color: var(--accent-lt); font-style: normal; }

.client-id-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.status-badge-wrap { display: flex; flex-direction: column; justify-content: flex-end; padding-top: 23px; flex-shrink: 0; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 0 12px; height: 38px; border-radius: 8px; white-space: nowrap; }
.status-connected { background: rgba(16,185,129,.12); color: #34d399; }
.status-disconnected { background: rgba(239,68,68,.1); color: #f87171; }

/* BUSCA DE PROPRIEDADES */
.fetch-section { margin-bottom: 20px; }

.fetch-results {
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.fetch-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  color: var(--muted);
  font-size: 13px;
}

.fetch-account {
  padding: 12px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.fetch-prop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  transition: background .12s;
}
.fetch-prop-item:hover { background: rgba(255,255,255,.03); }
.fetch-btn-row { display: flex; gap: 4px; flex-shrink: 0; }
.btn-proprio { background: rgba(16,185,129,.12); color: #34d399; }
.btn-proprio:hover { background: rgba(16,185,129,.25); }
.btn-cliente { background: rgba(96,165,250,.12); color: #60a5fa; }
.btn-cliente:hover { background: rgba(96,165,250,.25); }
.btn-portais { background: rgba(251,146,60,.12); color: #fb923c; }
.btn-portais:hover { background: rgba(251,146,60,.25); }

.fetch-prop-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.fetch-prop-info { flex: 1; min-width: 0; }
.fetch-prop-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fetch-prop-id { font-size: 11px; color: var(--muted); margin-top: 1px; }

.btn-add-prop {
  padding: 5px 14px;
  border-radius: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .15s;
  flex-shrink: 0;
}
.btn-add-prop.not-added { background: var(--accent-dim); color: var(--accent-lt); }
.btn-add-prop.not-added:hover { background: var(--accent); color: #fff; }
.btn-add-prop.added { background: rgba(16,185,129,.12); color: #34d399; cursor: default; }

.fetch-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* DIVISOR */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* LABEL SEÇÃO */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 20px 0 10px;
}

.add-property-form {
  display: grid;
  grid-template-columns: 2fr 1.5fr 2fr auto auto auto;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.add-property-form .field { margin-bottom: 0; }

.properties-list { display: flex; flex-direction: column; gap: 8px; }

.prop-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--bg); border-radius: 8px; }
.prop-info { flex: 1; min-width: 0; }
.prop-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-id-label { font-weight: 700; color: var(--muted); font-size: 12px; }
.prop-actions { display: flex; gap: 6px; flex-shrink: 0; }
.prop-author-dim { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.prop-author-label { font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.prop-author-input { width: 140px; height: 26px; padding: 0 8px; font-size: 11px; border-radius: 6px; background: var(--card); color: var(--dim); border: none; font-family: 'Manrope', sans-serif; }

.btn-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.btn-icon svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon:hover { color: var(--danger); background: rgba(239,68,68,.12); }

.msg { font-size: 12px; font-weight: 600; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.msg-ok  { background: rgba(16,185,129,.1); color: #34d399; }
.msg-err { background: rgba(239,68,68,.1);  color: #f87171; }

/* TOGGLE SWITCH */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--text); }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 22px;
  cursor: pointer; transition: background .2s;
}
.toggle-track::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }

/* RADIO GROUP */
.radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.radio-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); cursor: pointer; }
.radio-opt input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* LABEL HINT */
.label-hint { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* RECAPTCHA WIDGET */
.recaptcha-wrap { margin: 4px 0 8px; min-height: 0; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* SIDEBAR USER */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; margin: 0 8px 0;
  border-radius: 10px;
}
.sidebar-user-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-dim); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative; cursor: pointer; overflow: hidden;
}
.sidebar-user-avatar svg { stroke: var(--accent-lt); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: absolute; inset: 0; }
.avatar-camera-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
  color: #fff;
}
.sidebar-user-avatar:hover .avatar-camera-overlay { opacity: 1; }
.sidebar-user-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* USERS LIST */
.users-list-inner { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.user-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg); border-radius: 8px;
}
.user-item-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent-lt);
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.user-item-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: absolute; inset: 0; }
.user-item-info { flex: 1; min-width: 0; }
.user-item-name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-item-email { font-size: 11px; color: var(--muted); margin-top: 1px; }
.role-badge { font-size: 10px; font-weight: 700; height: 28px; padding: 0 10px; border-radius: 8px; text-transform: uppercase; letter-spacing: .4px; display: inline-flex; align-items: center; }
.role-admin   { background: rgba(124,58,237,.2); color: var(--accent-lt); }
.role-viewer  { background: rgba(100,116,139,.15); color: var(--muted); }
.role-cliente { background: rgba(37,99,235,.18); color: #60a5fa; }

/* PERMISSIONS LIST */
.perm-list { width: 100%; margin-top: 4px; }
.perm-list-header {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 14px 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
.perm-list-header-name { flex: 1; }
.perm-list-header-col { width: 80px; text-align: center; }
.perm-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg); border-radius: 8px;
  margin-bottom: 2px;
}
.perm-item-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent-lt);
  display: flex; align-items: center; justify-content: center;
}
.perm-item-label { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.perm-item-toggle { width: 80px; display: flex; justify-content: center; }
.badge-you {
  height: 28px; width: auto; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(16,185,129,.15);
  color: #34d399;
  font-size: 10px; font-weight: 700;
}

/* USER FORM */
.user-form-inline { display: grid; grid-template-columns: 2fr 2fr 1.5fr 1fr 1.2fr auto; gap: 12px; align-items: end; margin-top: 4px; }
.user-form-inline .field { margin-bottom: 0; }
@media (max-width: 960px) { .user-form-inline { grid-template-columns: 1fr 1fr; } }

/* USER EDIT INLINE */
.badge-meu-projeto { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 3px 8px; border-radius: 8px; background: rgba(245,158,11,.14); color: #fbbf24; white-space: nowrap; flex-shrink: 0; }
.user-client-badge { font-size: 10px; font-weight: 700; height: 28px; padding: 0 10px; border-radius: 8px; text-transform: uppercase; letter-spacing: .4px; display: inline-flex; align-items: center; background: rgba(245,158,11,.14); color: #fbbf24; white-space: nowrap; flex-shrink: 0; }
.user-edit-form { background: var(--bg); border-radius: 8px; padding: 14px 16px; margin: 4px 0 8px; }
.user-edit-form input,
.user-edit-form select { background: var(--card); border: none; }
.user-edit-fields { display: grid; grid-template-columns: 2fr 2fr 2fr 1fr; gap: 10px; }
.user-edit-fields .field { margin-bottom: 0; }
@media (max-width: 860px) { .user-edit-fields { grid-template-columns: 1fr 1fr; } }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* SEO MODE */
.btn-seo-float {
  position: fixed;
  bottom: 8px;
  right: 10px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}
.btn-seo-float:hover { background: var(--accent-lt); }
.btn-seo-float.seo-active { animation: seo-pulse 1.4s ease-in-out infinite; }
.btn-seo-float.seo-active:hover { animation: none; background: var(--accent-lt); }
@keyframes seo-pulse {
  0%, 100% { background: var(--accent); }
  50%       { background: var(--accent-lt); }
}

.seo-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(5,150,105,.15);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* AI KEYS GRID */
.ai-keys-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 4px; }
@media (max-width: 900px) { .ai-keys-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .ai-keys-grid { grid-template-columns: 1fr; } }
.api-key-wrap { position: relative; display: flex; align-items: center; }
.api-key-wrap input { width: 100%; padding-right: 60px; }
.api-saved-badge {
  position: absolute; right: 8px;
  font-size: 10px; font-weight: 700;
  color: #4ade80; background: rgba(74,222,128,.12);
  padding: 2px 7px; border-radius: 6px;
  pointer-events: none; white-space: nowrap;
}

/* ── BUSQUEMESEO ──────────────────────────────────────────────────────────── */

/* Input section */
.bseo-hero {
  text-align: center;
  padding: 48px 0 32px;
}
.bseo-hero-icon {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.bseo-hero-icon svg { stroke: var(--accent-lt); }
.bseo-hero-logo { width: 100px; height: auto; }
.bseo-hero h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.bseo-hero p  { color: var(--muted); font-size: 14px; }

.bseo-url-form { width: 100%; }
.bseo-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bseo-url-input {
  flex: 2;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  height: 48px;
}
.bseo-url-input--city { flex: 1.2; }
.bseo-url-input::placeholder { color: var(--muted); }
.bseo-url-input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent-dim); }
input[type="month"].bseo-url-input {
  border: none; cursor: pointer; background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M11.5 21h-5.5a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M15 19l2 2l4 -4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 38px; padding-right: 14px;
}
input[type="month"].bseo-url-input::-webkit-calendar-picker-indicator { opacity: 0; width: 100%; margin-left: -100%; cursor: pointer; }
input[type="month"].bseo-url-input:focus { box-shadow: none; }
.bseo-url-btn { flex-shrink: 0; height: 48px; padding: 0 20px; }
.bseo-url-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }

.bseo-config-hint {
  max-width: 600px;
  margin: 14px auto 0;
  padding: 10px 14px;
  background: rgba(245,158,11,.08);
  border-radius: 8px;
  font-size: 12px;
  color: #fcd34d;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Scan progress */
.bseo-scanning {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.bseo-scan-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 40px;
  width: 100%;
  max-width: 520px;
}
.bseo-scan-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.bseo-scan-favicon {
  width: 32px; height: 32px;
  object-fit: contain;
}
.bseo-scan-site {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
  text-align: center;
}
.bseo-scan-steps { display: flex; flex-direction: column; gap: 10px; }
.bseo-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background .2s;
}
.bseo-step[data-state="active"]  { background: rgba(124,58,237,.08); }
.bseo-step[data-state="done"]    { opacity: .55; }
.bseo-step[data-state="pending"] { opacity: .3; }
.bseo-step-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bseo-step-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--accent-lt);
  border-radius: 50%;
  display: none;
}
.bseo-step[data-state="active"] .bseo-step-spinner { display: block; animation: spin .7s linear infinite; }
.bseo-step-check { display: none; }
.bseo-step[data-state="done"] .bseo-step-spinner { display: none; }
.bseo-step[data-state="done"] .bseo-step-check { display: block; }
.bseo-step-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.bseo-step[data-state="pending"] .bseo-step-label { color: var(--muted); }
.bseo-step-time { font-size: 11px; font-weight: 700; color: var(--muted); min-width: 24px; text-align: right; flex-shrink: 0; }
.bseo-step[data-state="active"] .bseo-step-time { color: var(--accent-lt); }

/* ── Results ── */
.bseo-site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.bseo-site-name { font-size: 15px; font-weight: 800; }
.bseo-site-url  { font-size: 11px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.bseo-site-keyword { font-size: 11px; color: var(--accent-lt); margin-top: 2px; }

/* Placar */
.bseo-placar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.bseo-placar-score-wrap { text-align: center; flex-shrink: 0; }
.bseo-placar-num {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
}
.bseo-placar-slash { font-size: 28px; font-weight: 400; color: var(--muted); }
.bseo-placar-ia-text { font-size: 13px; font-weight: 700; margin-top: 8px; }
.bseo-placar-detail { flex: 1; min-width: 200px; }
.bseo-bar-ia { display: flex; gap: 8px; margin-bottom: 12px; }
.bseo-bar-ia-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform .2s;
}
.bseo-bar-ia-dot.citado    { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,.5); }
.bseo-bar-ia-dot.nao-citado { background: #334155; }
.bseo-bar-ia-dot.nc        { background: #1e293b; }
.bseo-cit-index-wrap { margin-top: 4px; }
.bseo-cit-score-line { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.bseo-cit-score-num { font-size: 28px; font-weight: 800; line-height: 1; }
.bseo-cit-score-denom { font-size: 14px; color: var(--muted); }
.bseo-cit-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.bseo-cit-label.verde   { background: rgba(16,185,129,.18); color: #34d399; }
.bseo-cit-label.laranja { background: rgba(245,158,11,.18); color: #fcd34d; }
.bseo-cit-label.vermelho{ background: rgba(239,68,68,.15);  color: #f87171; }
.bseo-cit-desc { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* Grid principal de cards */
.bseo-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Card base */
.bseo-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.bseo-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
.bseo-card-title svg { stroke: var(--accent-lt); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.bseo-card-subtitle { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }

/* "Como analisamos" */
.bseo-analise-name { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.bseo-analise-desc { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.bseo-analise-termo { font-size: 12px; margin-bottom: 8px; }
.bseo-analise-termo strong { color: var(--accent-lt); }
.bseo-analise-hint { font-size: 10px; color: var(--muted); font-style: italic; }

/* Por IA (recomendação) */
.bseo-ias-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.res-ia {
  background: rgba(255,255,255,.03);
  border-radius: 10px;
  padding: 14px 16px;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.res-ia.citado     { border-color: rgba(16,185,129,.3); }
.res-ia.nao-citado { border-color: rgba(239,68,68,.18); }
.res-ia.nc         { opacity: .55; }
.res-ia.locked     { opacity: .7; }
.res-badge.laranja { background: rgba(251,146,60,.15); color: #fb923c; }
.res-ia-header { display: flex; align-items: center; justify-content: space-between; }
.res-ia-name { font-size: 13px; font-weight: 800; }
.res-ia-icon { display: flex; align-items: center; line-height: 1; }
.res-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.res-badge.verde   { background: rgba(16,185,129,.15); color: #34d399; }
.res-badge.vermelho{ background: rgba(239,68,68,.12);  color: #f87171; }
.res-badge.cinza   { background: rgba(100,116,139,.15); color: var(--muted); }
.res-ia-text { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* Reconhecimento de marca */
.bseo-marca-list { display: flex; flex-direction: column; gap: 10px; }
.bseo-marca-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(255,255,255,.02);
  border-radius: 8px;
}
.bseo-marca-icon { display: flex; align-items: center; flex-shrink: 0; margin-top: 1px; }
.bseo-marca-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.bseo-marca-trecho { font-size: 11px; color: var(--muted); line-height: 1.5; font-style: italic; }
.bseo-marca-conclusao { margin-top: 12px; font-size: 12px; color: var(--dim); line-height: 1.5; padding: 10px 12px; background: rgba(124,58,237,.07); border-radius: 8px; border-left: 3px solid var(--accent); }

/* Concorrentes */
.bseo-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.bseo-rank-num { font-size: 11px; font-weight: 800; color: var(--muted); width: 20px; flex-shrink: 0; }
.bseo-rank-name { flex: 1; font-size: 13px; font-weight: 700; }
.bseo-rank-ias { font-size: 10px; color: var(--muted); background: rgba(255,255,255,.05); padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.bseo-rank-blur { filter: blur(5px); pointer-events: none; user-select: none; }
.bseo-rank-more { font-size: 11px; color: var(--muted); margin-top: 10px; text-align: center; font-style: italic; }

/* Entidade KG */
.bseo-kg-row { display: flex; align-items: flex-start; gap: 14px; }
.bseo-kg-icon { display: flex; align-items: center; flex-shrink: 0; }
.bseo-kg-text { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.bseo-kg-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Fontes */
.bseo-sources-count {
  display: flex;
  gap: 24px;
  margin-top: 14px;
}
.bseo-source-item { text-align: center; }
.bseo-source-num { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.bseo-source-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.bseo-sources-hint { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.5; }

/* Perfil Google */
.bseo-gmaps-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bseo-gmaps-nota { font-size: 28px; font-weight: 800; color: #fcd34d; line-height: 1; }
.bseo-gmaps-stars { font-size: 14px; color: #fcd34d; }
.bseo-gmaps-info { font-size: 12px; color: var(--muted); }
.bseo-gmaps-category { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--accent-lt); font-weight: 700; margin-top: 2px; }
.bseo-lacunas-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bseo-lacuna-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bseo-lacuna-item::before { content: '✗'; color: #f87171; font-weight: 800; flex-shrink: 0; }
.bseo-completude-bar-wrap { margin-bottom: 16px; }
.bseo-completude-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.bseo-completude-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.bseo-completude-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-lt)); transition: width .4s; }
.bseo-tarefas-list { display: flex; flex-direction: column; gap: 8px; }
.bseo-tarefa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.02);
  border-radius: 8px;
}
.bseo-tarefa-badge {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.bseo-tarefa-badge.alto   { background: rgba(239,68,68,.12);  color: #f87171; }
.bseo-tarefa-badge.medio  { background: rgba(245,158,11,.12); color: #fcd34d; }
.bseo-tarefa-text { font-size: 12px; font-weight: 600; flex: 1; }
.bseo-tarefa-tempo { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* Fundamentos */
.bseo-fund-score { font-size: 32px; font-weight: 800; margin-bottom: 16px; }
.bseo-fund-score span { font-size: 16px; font-weight: 400; color: var(--muted); }
.bseo-fund-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.bseo-fund-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bseo-fund-icon.ok   { background: rgba(16,185,129,.15); color: #34d399; }
.bseo-fund-icon.fail { background: rgba(239,68,68,.12);  color: #f87171; }
.bseo-fund-name { font-size: 13px; font-weight: 700; }
.bseo-fund-desc { font-size: 11px; color: var(--muted); margin-top: 1px; }
.bseo-fund-explainer { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.6; padding: 10px 12px; background: rgba(255,255,255,.02); border-radius: 8px; }

/* PageSpeed card */
.bseo-ps-score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 20px; }
.bseo-ps-metrics { display: flex; flex-direction: column; gap: 10px; }
.bseo-ps-metric { display: flex; align-items: center; gap: 10px; }
.bseo-ps-metric-label { font-size: 11px; font-weight: 700; color: var(--muted); width: 80px; flex-shrink: 0; }
.bseo-ps-metric-val { font-size: 12px; font-weight: 700; width: 72px; flex-shrink: 0; text-align: right; }
.bseo-ps-metric-bar { flex: 1; height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.bseo-ps-metric-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }

/* Action plan */
.bseo-actions-list { display: flex; flex-direction: column; gap: 10px; }
.bseo-action {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.bseo-action-high   { background: rgba(239,68,68,.06);   border-color: var(--danger); }
.bseo-action-medium { background: rgba(245,158,11,.06);  border-color: var(--warn); }
.bseo-action-low    { background: rgba(16,185,129,.06);  border-color: var(--success); }
.bseo-action-content { flex: 1; min-width: 0; }
.bseo-action-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.bseo-action-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }
.bseo-action-badge {
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  align-self: flex-start;
}
.bseo-action-badge.high   { background: rgba(239,68,68,.15);  color: #f87171; }
.bseo-action-badge.medium { background: rgba(245,158,11,.15); color: #fcd34d; }
.bseo-action-badge.low    { background: rgba(16,185,129,.15); color: #34d399; }

/* CWV inline */
.bseo-cwv { text-align: center; padding: 8px 0; }
.bseo-cwv-score { font-size: 40px; font-weight: 800; line-height: 1; }
.bseo-cwv-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.bseo-cwv-metrics { display: flex; justify-content: center; gap: 16px; margin-top: 14px; }
.bseo-cwv-m { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bseo-cwv-m span { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.bseo-cwv-m strong { font-size: 13px; font-weight: 700; color: var(--text); }
.bseo-cwv-na { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  .bseo-placar { flex-direction: column; gap: 20px; }
  .bseo-ias-row { grid-template-columns: 1fr; }
}

/* ── SIDEBAR COLLAPSE ─────────────────────────────────────────────────────── */
.sidebar { transition: width 0.25s ease; overflow: hidden; }

/* Tooltip recolhido */
.sidebar-tooltip {
  position: fixed;
  background: #1e2d45;
  color: var(--text);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 500;
  border-left: 2px solid var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.sidebar-tooltip.visible {
  opacity: 1;
  transform: translateX(0);
}

.nav-label {
  overflow: hidden;
  white-space: nowrap;
  max-width: 160px;
  opacity: 1;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}
.sidebar-user-info {
  overflow: hidden;
  max-width: 140px;
  opacity: 1;
  transition: max-width 0.25s ease, opacity 0.15s ease;
  min-width: 0;
}
.nav-section {
  transition: height 0.25s ease, padding 0.25s ease, margin 0.25s ease, opacity 0.2s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: 84px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-user-info { max-width: 0; opacity: 0; pointer-events: none; }
.sidebar.collapsed .nav-section { height: 0; padding: 0; margin: 0; opacity: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .nav-item svg { width: 24px; height: 24px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0 0 24px; }
.sidebar.collapsed .sidebar-logo-full { display: none; }
.sidebar.collapsed .sidebar-logo-sm   { display: block; }
.sidebar.collapsed .sidebar-user { gap: 0; }
.sidebar.collapsed .sidebar-user-avatar { box-shadow: 0 0 0 3px var(--bg); }

/* Toggle button */
#btn-sidebar-toggle {
  position: fixed;
  top: 78px;
  left: 207px; /* 220 - 13 */
  width: 26px; height: 26px;
  background: var(--accent);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  color: #fff;
  transition: left 0.25s ease, background 0.15s;
  flex-shrink: 0;
}
#btn-sidebar-toggle:hover { background: var(--accent-lt); }
#screen-app.active #btn-sidebar-toggle { display: flex; }

#btn-theme-toggle {
  position: fixed;
  top: 112px;
  left: 207px;
  width: 26px; height: 26px;
  background: var(--accent);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  color: #fff;
  transition: left 0.25s ease, background 0.15s;
  flex-shrink: 0;
}
#btn-theme-toggle svg { stroke: #fff; }
#btn-theme-toggle:hover { background: var(--accent-lt); }
#screen-app.active #btn-theme-toggle { display: flex; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar-brand span, .nav-item span, .sidebar-logout span { display: none; }
  .sidebar-brand { justify-content: center; padding: 0 0 24px; }
  .sidebar-logo-img { height: 24px; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-logout { justify-content: center; padding: 12px; }
  .view { padding: 24px 16px; }
  .add-property-form { grid-template-columns: 1fr 1fr; }
  #btn-sidebar-toggle,
  #btn-theme-toggle { display: none !important; }
}

@media (max-width: 600px) {
  .view-header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
  .add-property-form { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   RES-* — BusqueMeSEO resultado novo layout
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar ── */
.res-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.res-back {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 12px;
  background: rgba(255,255,255,.05); border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--dim);
  border: none; cursor: pointer; flex-shrink: 0;
}
.res-back:hover { background: rgba(255,255,255,.09); }
.res-site-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 8px;
  padding: 6px 12px; overflow: hidden;
}
.res-site-pill img { width: 18px; height: 18px; border-radius: 3px; flex-shrink: 0; }
.res-site-pill-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-site-pill-url  { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-site-pill-sep  { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.res-keyword-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(124,58,237,.15); border-radius: 8px;
  padding: 6px 12px; font-size: 11px; font-weight: 700; color: var(--accent-lt);
  white-space: nowrap; flex-shrink: 0;
}

/* ── Hero Score ── */
.res-hero {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: auto 1px 1fr 1px 1fr;
  gap: 0 28px;
  align-items: center;
}
.res-hero-div { width: 1px; height: 60px; background: var(--border); }

.res-hero-score { text-align: center; }
.res-hero-num {
  font-size: 64px; font-weight: 800; line-height: 1;
}
.res-hero-num span { font-size: 24px; font-weight: 400; color: var(--muted); }
.res-hero-label { font-size: 12px; font-weight: 700; color: var(--dim); margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; }
.res-hero-dots { display: flex; gap: 7px; justify-content: center; margin-top: 10px; }
.res-dot { width: 10px; height: 10px; border-radius: 50%; }
.res-dot.ok  { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,.5); }
.res-dot.no  { background: #334155; }
.res-dot.nc  { background: #1e293b; }

.res-hero-index-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.res-hero-index-num { font-size: 32px; font-weight: 800; }
.res-hero-index-denom { font-size: 13px; color: var(--muted); }
.res-hero-badge {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.res-hero-desc { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; white-space: nowrap; }

.res-hero-ps-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.res-hero-ps-num { font-size: 32px; font-weight: 800; }
.res-hero-ps-label { font-size: 13px; color: var(--muted); }
.res-ps-mini-metrics { display: flex; flex-direction: column; gap: 6px; }
.res-ps-mini-row { display: flex; align-items: center; gap: 8px; }
.res-ps-mini-name { font-size: 11px; color: var(--muted); width: 36px; flex-shrink: 0; }
.res-ps-mini-val  { font-size: 11px; font-weight: 700; width: 52px; flex-shrink: 0; }
.res-ps-mini-bar  { flex: 1; height: 3px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.res-ps-mini-fill { height: 100%; border-radius: 2px; }

/* ── Grid de cards ── */
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.res-grid-full { grid-column: 1 / -1; }

/* Card base */
.res-card {
  background: #1a1a2e94;
  border-radius: var(--radius);
  padding: 20px 22px;
}
.res-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: var(--dim);
  margin-bottom: 16px;
}
.res-card-title svg { stroke: var(--accent-lt); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Por IA ── */
.res-ia-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.res-ia-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.res-ia-item-header { display: flex; align-items: center; justify-content: space-between; }
.res-ia-item-name { font-size: 13px; font-weight: 800; }
.res-ia-item-icon { display: flex; align-items: center; }
.res-ia-item.ok   .res-ia-item-icon { color: #34d399; }
.res-ia-item.fail .res-ia-item-icon { color: #f87171; }
.res-ia-item.lock { opacity: .6; }
.res-ia-item.lock .res-ia-item-icon { color: var(--muted); }
.res-ia-item-text { font-size: 11px; color: var(--muted); line-height: 1.5; }
.res-ia-resposta {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ── Badges ── */
.res-badge {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.res-badge.verde    { background: rgba(16,185,129,.15); color: #34d399; }
.res-badge.vermelho { background: rgba(239,68,68,.12);  color: #f87171; }
.res-badge.cinza    { background: rgba(100,116,139,.15); color: var(--muted); }
.res-badge.laranja  { background: rgba(251,146,60,.15); color: #fb923c; }

/* ── Marca ── */
.res-marca-list { display: flex; flex-direction: column; gap: 12px; }
.res-marca-item { display: flex; align-items: flex-start; gap: 10px; }
.res-marca-icon { display: flex; align-items: center; flex-shrink: 0; margin-top: 1px; }
.res-marca-name { font-size: 13px; font-weight: 700; }
.res-marca-trecho { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.res-marca-summary { font-size: 12px; color: var(--muted); margin-top: 14px; padding: 10px 12px; background: rgba(255,255,255,.02); border-radius: 8px; line-height: 1.6; }

/* ── Concorrentes ── */
.res-comp-list { display: flex; flex-direction: column; gap: 8px; }
.res-comp-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.res-comp-num  { font-size: 11px; font-weight: 800; color: var(--muted); width: 18px; flex-shrink: 0; }
.res-comp-name { font-size: 13px; font-weight: 700; flex: 1; }
.res-comp-site { font-size: 11px; color: var(--muted); }
.res-comp-count { font-size: 10px; font-weight: 700; background: rgba(239,68,68,.1); color: #f87171; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }

/* ── Entidade / GMaps ── */
.res-entity-row { display: flex; align-items: flex-start; gap: 12px; }
.res-entity-icon { display: flex; align-items: center; flex-shrink: 0; margin-top: 2px; }
.res-entity-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.res-entity-desc  { font-size: 11px; color: var(--muted); line-height: 1.5; }

.res-gmaps-nota  { font-size: 28px; font-weight: 800; color: #fcd34d; margin-bottom: 4px; }
.res-gmaps-stars { font-size: 14px; color: #fcd34d; letter-spacing: 2px; }
.res-gmaps-info  { font-size: 11px; color: var(--muted); margin-top: 4px; }
.res-gmaps-tags  { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.res-gmaps-tag   { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.res-gmaps-tag.ok   { background: rgba(16,185,129,.12); color: #34d399; }
.res-gmaps-tag.warn { background: rgba(245,158,11,.12); color: #fcd34d; }

/* ── Fontes ── */
.res-fontes-nums { display: flex; gap: 20px; margin-bottom: 12px; }
.res-fonte-num   { font-size: 28px; font-weight: 800; }
.res-fonte-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.res-fontes-hint { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── Fundamentos ── */
.res-fund-score { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.res-fund-score span { font-size: 16px; font-weight: 400; color: var(--muted); }
.res-fund-list { display: flex; flex-direction: column; gap: 0; }
.res-fund-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.res-fund-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.res-fund-icon.ok   { background: rgba(16,185,129,.15); color: #34d399; }
.res-fund-icon.fail { background: rgba(239,68,68,.12);  color: #f87171; }
.res-fund-name { font-size: 13px; font-weight: 700; }
.res-fund-desc { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── Core Web Vitals ── */
.res-cwv-score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 18px; }
.res-cwv-num   { font-size: 36px; font-weight: 800; }
.res-cwv-sub   { font-size: 13px; color: var(--muted); }
.res-cwv-list  { display: flex; flex-direction: column; gap: 9px; }
.res-cwv-row   { display: flex; align-items: center; gap: 8px; }
.res-cwv-label { font-size: 11px; font-weight: 700; color: var(--muted); width: 80px; flex-shrink: 0; }
.res-cwv-val   { font-size: 11px; font-weight: 700; width: 60px; flex-shrink: 0; text-align: right; }
.res-cwv-bar   { flex: 1; height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.res-cwv-fill  { height: 100%; border-radius: 2px; }

/* ── Ahrefs ── */
.ah-overview { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ah-stat { flex: 1; min-width: 100px; padding: 12px 14px; text-align: center; border-radius: 10px; background: rgba(124,58,237,.08); }
.ah-stat-val { font-size: 16px; font-weight: 600; line-height: 1; }
.ah-stat-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }
.ah-kw-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ah-kw-chip { background: rgba(124,58,237,.08); border-radius: 8px; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ah-kw-chip-val   { font-size: 16px; font-weight: 600; }
.ah-kw-chip-label { font-size: 10px; color: var(--muted); }
.ah-section-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 7px; }
.ah-tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ah-list { display: flex; flex-direction: column; gap: 5px; }
.ah-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.ah-item-main { flex: 1; min-width: 0; }
.ah-item-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-item-sub  { font-size: 10px; color: var(--muted); margin-top: 1px; }
.ah-dr-badge { display: inline-block; min-width: 28px; text-align: center; padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.ah-dr-hi  { background: rgba(52,211,153,.15); color: #34d399; }
.ah-dr-mid { background: rgba(251,146,60,.15);  color: #fb923c; }
.ah-dr-lo  { background: rgba(248,113,113,.10); color: #f87171; }
.ah-pos-badge { display: inline-block; min-width: 30px; text-align: center; padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.ah-pos-top { background: rgba(52,211,153,.12); color: #34d399; }
.ah-pos-mid { background: rgba(251,146,60,.12);  color: #fb923c; }
.ah-pos-low { background: rgba(248,113,113,.10); color: #f87171; }

/* ── Plano de ação ── */
.res-actions { display: flex; flex-direction: column; gap: 10px; }
.res-action {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  border-left: 3px solid transparent;
}
.res-action.high   { background: rgba(239,68,68,.06);   border-color: var(--danger); }
.res-action.medium { background: rgba(245,158,11,.06);  border-color: var(--warn); }
.res-action.low    { background: rgba(16,185,129,.06);  border-color: var(--success); }
.res-action-content { flex: 1; min-width: 0; }
.res-action-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.res-action-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }
.res-action-badge {
  flex-shrink: 0; align-self: center;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
}
.res-action-badge.high   { background: rgba(239,68,68,.15);  color: #f87171; }
.res-action-badge.medium { background: rgba(245,158,11,.15); color: #fcd34d; }
.res-action-badge.low    { background: rgba(16,185,129,.15); color: #34d399; }

/* SVG helper */
svg.ico { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Histórico ── */
.hist-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.hist-title { font-size: 18px; font-weight: 800; }
.hist-header-actions { display: flex; align-items: center; gap: 8px; }
.hist-tabs  { display: flex; gap: 6px; }
.hist-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 48px 0; }
.hist-cb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
  background: #1a2438; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; transition: background .15s;
}
.hist-cb::after {
  content: '';
  display: block;
  width: 10px; height: 7px;
  border-left: 2px solid #34d399;
  border-bottom: 2px solid #34d399;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0; transition: opacity .15s;
}
.hist-cb:checked { background: rgba(16,185,129,.15); }
.hist-cb:checked::after { opacity: 1; }
.hist-type-badge { border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 11px; border-radius: 6px; padding: 2px 8px; height: auto; flex-shrink: 0; }
.hist-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 6px;
  cursor: pointer; transition: background .15s; gap: 12px;
}
.hist-item:hover { background: var(--card-hover); }
.hist-item-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 1; }
.hist-item-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hist-favicon    { width: 20px; height: 20px; border-radius: 3px; flex-shrink: 0; }
.hist-item-name  { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; }
.hist-kw         { background: rgba(124,58,237,.15); color: var(--accent-lt); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.hist-ia-tag     { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0 2px; }
.hist-ia-tag.ok  { opacity: 1; }
.hist-ia-tag.fail{ opacity: .3; }
.hist-tech-tag   { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 2px 7px; flex-shrink: 0; }
.hist-perf       { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.hist-score-num  { font-size: 13px; font-weight: 800; flex-shrink: 0; white-space: nowrap; }
.hist-score-lbl  { font-size: 11px; color: var(--muted); font-weight: 500; }
.hist-date       { font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.hist-avatar     { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.hist-avatar-placeholder { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase; }

/* ── DS Save popup ── */
.ds-save-popup { position: absolute; top: calc(100% + 8px); right: 0; background: var(--card); border-radius: 10px; padding: 10px; z-index: 200; min-width: 200px; box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.ds-save-popup.hidden { display: none; }
.ds-save-popup-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; padding: 0 2px; }
.ds-save-type-btn { display: flex; align-items: center; width: 100%; text-align: left; padding: 8px 12px; border-radius: 7px; border: none; background: none; color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s; gap: 6px; }
.ds-save-type-btn:hover { background: rgba(124,58,237,.12); color: var(--accent-lt); }

/* ── DS Reports list ── */
.ds-rpt-row { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 10px; padding: 10px 14px; margin-bottom: 6px; cursor: pointer; transition: background .15s; gap: 12px; }
.ds-rpt-row:hover { background: var(--card-hover); }
.ds-rpt-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ds-rpt-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ds-rpt-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.ds-rpt-meta { font-size: 11px; color: var(--muted); white-space: nowrap; margin-top: 2px; }
.ds-rpt-stat { font-size: 11px; font-weight: 700; background: rgba(124,58,237,.12); color: var(--accent-lt); border-radius: 5px; padding: 2px 8px; white-space: nowrap; }
.ds-rpt-stat-ah { background: rgba(245,158,11,.12); color: #fbbf24; }
.ds-rpt-date { font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.ds-rpt-del { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; border: none; background: none; color: var(--muted); cursor: pointer; flex-shrink: 0; transition: color .12s, background .12s; }
.ds-rpt-del:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.ds-rpt-type-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 5px; border: none; flex-shrink: 0; }
.ds-rpt-type-badge.cliente { background: rgba(59,130,246,.14); color: #60a5fa; }
.ds-rpt-type-badge.proprio { background: rgba(16,185,129,.12); color: #34d399; }
.ds-rpt-type-badge.portais { background: rgba(245,158,11,.12); color: #fbbf24; }
.ds-rpt-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 40px 16px; }

/* ── Modal resultado histórico ── */
.hist-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0; overflow: hidden;
}
.hist-modal-overlay.hidden { display: none; }
.hist-modal-panel {
  background: var(--bg); width: 100%; max-width: 900px; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: -4px 0 40px rgba(0,0,0,.5);
}
.hist-modal-topbar {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px; flex-shrink: 0; position: relative; z-index: 1;
  transition: box-shadow .2s;
}
.hist-modal-topbar.scrolled {
  box-shadow: 0 6px 28px 0 #0000001c;
}
.hist-modal-logo {
  height: 68px; width: auto; opacity: .85;
}
.hist-modal-actions {
  position: absolute; right: 16px; display: flex; align-items: center; gap: 6px;
}
.hist-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.06); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.hist-modal-close:hover { background: rgba(239,68,68,.15); color: #f87171; }
.hist-modal-body {
  flex: 1; overflow-y: auto; padding: 32px 36px;
}

/* ── Responsive res-* ── */
@media (max-width: 700px) {
  .res-hero {
    grid-template-columns: 1fr;
    gap: 20px 0;
  }
  .res-hero-div { display: none; }
  .res-grid { grid-template-columns: 1fr; }
  .res-ia-grid { grid-template-columns: 1fr; }
}

/* ── Print / PDF ── */
/* ── DATA STUDIO ────────────────────────────────────────────────────────────── */
/* Selects no estilo bseo-url-input */
#ds-prop-select  { flex: 2; }
#ds-range-select { flex: 1; min-width: 160px; }
#seo-rpt-site {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px; padding-right: 14px;
}
#seo-rpt-month {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M11.5 21h-5.5a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M15 19l2 2l4 -4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px; padding-right: 14px;
}
#seo-rpt-bl-client {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 15l6 -6'/%3E%3Cpath d='M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464'/%3E%3Cpath d='M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px; padding-right: 14px;
}
/* Ícones — ferramentas/analisar */
#bseo-url {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6'/%3E%3Cpath d='M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0'/%3E%3Cpath d='M8 11v-4a4 4 0 1 1 8 0v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px;
}
#bseo-kw {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M14.185 13.14l5.644 -2.202c1.625 -.634 1.538 -2.962 -.13 -3.473l-14.319 -4.382c-1.41 -.431 -2.73 .888 -2.298 2.298l4.382 14.318c.51 1.668 2.84 1.755 3.473 .13l2.202 -5.644a1.84 1.84 0 0 1 1.045 -1.045'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px;
}
#bseo-city {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4'/%3E%3Cpath d='M9 15l-4.5 4.5'/%3E%3Cpath d='M14.5 4l5.5 5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px;
}
#ds-prop-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px; padding-right: 14px;
}
#ds-range-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M11.5 21h-5.5a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M15 19l2 2l4 -4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px; padding-right: 14px;
}
select.bseo-url-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  background-color: var(--bg);
  border: none;
  text-transform: none;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select.bseo-url-input option { background: var(--bg); color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Topbar */
.ds-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; position: sticky; top: 8px; z-index: 60;
  padding: 10px; border-radius: 8px;
  margin-bottom: 16px; transition: background .25s, box-shadow .25s;
}
.ds-topbar.scrolled {
  background: linear-gradient(135deg, rgba(30,48,80,.85) 0%, rgba(17,25,36,.85) 55%, rgba(12,16,26,.85) 100%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
body.light .ds-topbar.scrolled {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.ds-topbar-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ds-topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-report-favicon { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.ds-report-name   { font-size: 14px; font-weight: 700; white-space: nowrap; }
.ds-report-sep    { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.ds-report-period { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* KPI strip — cards individuais com gap */
.ds-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.ds-kpi {
  background: #1a1a2e94;
  border-radius: var(--radius);
  padding: 16px 18px;
}
.ds-kpi-label { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-kpi-value { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1; }
.ds-kpi-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ds-kpi-delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 20px; font-size: 10px; font-weight: 700; vertical-align: middle; margin-left: 4px; }
.ds-kpi-delta.up   { background: rgba(16,185,129,.12); color: var(--success); }
.ds-kpi-delta.down { background: rgba(239,68,68,.10);  color: var(--danger); }

/* Layout principal — grid com gap */
.ds-main-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}
.ds-card {
  background: #1a1a2e94;
  border-radius: var(--radius);
  padding: 20px 22px;
}
/* card do gráfico cresce para preencher altura disponível */
.ds-card-chart { display: flex; flex-direction: column; }
.ds-card-chart .ds-chart-area { flex: 1; min-height: 0; }
.ds-card-chart .ds-chart-area svg { width: 100%; height: 100%; display: block; }
.ds-card-head  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.ds-card-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Legend */
.ds-legend      { display: flex; gap: 14px; align-items: center; }
.ds-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.ds-legend-bar  { display: inline-block; width: 12px; height: 10px; background: var(--accent); border-radius: 2px; opacity: .8; }
.ds-legend-line { display: inline-block; width: 22px; height: 2px; background: none; border-top: 2px dashed var(--accent-lt); position: relative; }
.ds-legend-line::after { content:''; position:absolute; right:-1px; top:-5px; width:8px; height:8px; border-radius:50%; background:var(--accent-lt); }

/* Gráfico SVG */
.ds-chart-area { width: 100%; overflow: hidden; }
.ds-chart-area svg { width: 100%; display: block; }

/* Grades de tabelas com gap */
.ds-bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}
.ds-table-wrap { overflow: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ds-table thead tr { border-bottom: 1px solid var(--border); }
.ds-table th {
  text-align: left; font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 4px 8px; white-space: nowrap;
}
.ds-table th:not(:first-child) { text-align: right; }
.ds-table td { padding: 7px 4px; color: var(--text); border-bottom: 1px dotted rgba(255,255,255,.07); font-size: 12px; }
.ds-table td:not(:first-child) { text-align: right; }
.ds-table tr:last-child td { border-bottom: none; }
.ds-table tr:hover td { background: rgba(255,255,255,.02); }
.ds-td-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.ds-td-muted { color: var(--muted); }

/* Badge de número */
.ds-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(124,58,237,.18);
  color: var(--accent-lt);
  letter-spacing: .01em;
}
.ds-badge-2 { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .01em; background: rgba(124,58,237,.10); color: var(--accent-lt); }
.ds-badge-3 { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .01em; background: rgba(124,58,237,.06); color: var(--dim); }
.ds-badge-qw { display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:20px;font-size:11px;font-weight:700;background:rgba(16,185,129,.15);color:var(--success);letter-spacing:.01em;max-width:100% }
.ds-badge-qw .ds-td-name { color:var(--success) }

/* Expand rows */
.ds-table-wrap.ds-collapsed { max-height: 230px; overflow: hidden; }
.ds-expand-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; padding: 7px 4px 2px;
  font-size: 11px; font-weight: 700; font-family: var(--font, 'Manrope', sans-serif);
  color: var(--accent-lt); background: none; border: none;
  border-top: 1px solid rgba(255,255,255,.05); cursor: pointer;
  letter-spacing: .03em; margin-top: 4px;
}
.ds-expand-btn:hover { color: var(--text); }
.ds-expand-btn svg { flex-shrink: 0; }

/* Filtro de fonte — ocultar seções */
[data-source].ds-hidden { display: none !important; }

/* Seção avançada — divider + label */
.ds-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
}
.ds-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ds-section-title svg { opacity: .6; }

/* Fonte da API no cabeçalho do card */
.ds-card-head { display: flex; align-items: center; justify-content: space-between; }
.ds-prop-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  background: rgba(124,58,237,.15);
  color: var(--accent-lt);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
  margin-left: 2px;
}
.ds-card-src {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(124,58,237,.12);
  color: var(--accent-lt);
  letter-spacing: .04em;
}
.ds-card-src-sc { background: rgba(59,130,246,.14); color: #60a5fa; }
.ds-card-src-ah { background: rgba(245,158,11,.14);  color: var(--warn); }

/* Loading dots */
.ds-loading { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 32px 16px; }
.ds-loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ds-bounce 1.2s ease-in-out infinite; }
.ds-loading span:nth-child(2) { animation-delay: .18s; }
.ds-loading span:nth-child(3) { animation-delay: .36s; }
@keyframes ds-bounce { 0%, 80%, 100% { transform: scale(.55); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }

/* Skeleton */
.ds-skel { background: var(--border); border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }

@media (max-width: 1200px) {
  .ds-kpi-strip   { grid-template-columns: repeat(3, 1fr); }
  .ds-main-grid   { grid-template-columns: 1fr 1fr; }
  .ds-main-grid > :last-child { grid-column: 1 / -1; }
  .ds-bottom-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  *, *::before, *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* quando is-printing: esconde tudo, mostra só #print-area */
  body.is-printing > *:not(#print-area) { display: none !important; }

  #print-area {
    display: block !important;
    background: #0d1117 !important;
    color: #e2e8f0 !important;
    font-family: 'Manrope', sans-serif;
    padding: 28px 32px 32px;
  }

  /* cabeçalho */
  .pdf-header {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding-bottom: 14px;
    margin-bottom: 18px;
  }
  .pdf-header-side { flex: 1; }
  .pdf-logo { height: 48px; width: auto; }
  .pdf-header-actions {
    flex: 1;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }
  .pdf-action-icon {
    width: 32px; height: 32px;
    background: rgba(124,58,237,.18);
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    text-decoration: none;
  }

  /* converter grids em bloco para evitar overflow no print */
  #print-area .res-grid      { display: block !important; }
  #print-area .res-grid-full { display: block !important; width: 100% !important; }
  #print-area .res-ia-grid   { display: block !important; }
  #print-area .res-ia-item   { margin-bottom: 8px !important; break-inside: avoid; }
  #print-area .ah-tables     { display: grid !important; grid-template-columns: 1fr 1fr !important; }
  #print-area .res-hero      { grid-template-columns: auto 1px 1fr 1px 1fr !important; }
  #print-area .res-hero-div  { display: block !important; }

  /* cards e fundos escuros, sem quebras internas */
  #print-area .res-card { background: #111924 !important; margin-bottom: 12px; page-break-inside: avoid; break-inside: avoid; }
  #print-area .ah-item  { background: #0d1117 !important; }
  #print-area .res-ia-item { break-inside: avoid; }

  /* ocultar interativos */
  #print-area button,
  #print-area .res-back,
  #print-area .res-topbar,
  #print-area .res-keyword-pill { display: none !important; }
}


/* ── Relatórios SEO ─────────────────────────────────────────── */
.seo-rpt-form { margin-top: 16px; }
.seo-rpt-row {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.seo-rpt-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.seo-rpt-field-action { flex: 0 0 auto; min-width: auto; }
.seo-rpt-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.seo-rpt-select,
.seo-rpt-input {
  background: var(--surface); border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.seo-rpt-select:focus,
.seo-rpt-input:focus { border-color: var(--accent); }
.seo-rpt-select option { background: var(--bg); }
.seo-rpt-textarea {
  width: 100%; background: var(--surface); border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px; padding: 10px 12px; color: var(--text);
  font-size: 12px; font-family: inherit; line-height: 1.6; resize: vertical;
  outline: none; transition: border-color .15s;
}
.seo-rpt-textarea:focus { border-color: var(--accent); }
.seo-rpt-manual-section { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.05); }
.seo-rpt-manual-section:first-child { border-top: none; padding-top: 0; }

.seo-rpt-kpis-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.seo-rpt-kpi {
  background: rgba(255,255,255,.04); border-radius: 10px; padding: 14px 16px;
}
.seo-rpt-kpi-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.seo-rpt-kpi-value { font-size: 20px; font-weight: 700; line-height: 1; }
.seo-rpt-kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Linha de link building */
.seo-rpt-link-input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 12px; font-family: inherit;
  width: 100%; padding: 2px 4px;
}
.seo-rpt-link-input::placeholder { color: var(--muted); }
.seo-rpt-link-del {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.seo-rpt-link-del:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* Lista de relatórios gerados */
.seo-rpt-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; background: rgba(255,255,255,.03);
  border-radius: 10px; margin-bottom: 8px;
  transition: background .15s;
}
.seo-rpt-item:hover { background: rgba(255,255,255,.06); }
.seo-rpt-item-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(124,58,237,.15); display: flex; align-items: center;
  justify-content: center; color: var(--accent-lt); flex-shrink: 0;
}
.seo-rpt-item-info { flex: 1; min-width: 0; }
.seo-rpt-item-name { font-size: 13px; font-weight: 700; }
.seo-rpt-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.seo-rpt-item-actions { display: flex; gap: 6px; }

/* ══════════════════════════════════════════
   BACKLINKS CLIENTES
══════════════════════════════════════════ */
/* Sidebar clientes */
.bl-clients-sidebar {
  width: 210px; flex-shrink: 0;
  background: rgba(12,16,26,.6);
  display: flex; flex-direction: column; overflow: hidden;
}
.bl-clients-head { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.bl-clients-head-top { display: flex; align-items: center; justify-content: space-between; }
.bl-clients-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.bl-client-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 12px 4px; opacity: .6; }
.bl-client-group-label-cancelled { opacity: .4; }
.bl-clients-search {
  width: 100%; padding: 0 10px; height: 26px; border-radius: 7px;
  background: var(--card); border: none;
  color: var(--text); font-family: inherit; font-size: 12px; outline: none;
}
.bl-clients-search::placeholder { color: var(--muted); }
.bl-clients-list { flex: 1; overflow-y: auto; padding: 6px; }
.bl-clients-list::-webkit-scrollbar { width: 4px; }
.bl-clients-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.bl-client-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .12s;
}
.bl-client-item:hover { background: rgba(255,255,255,.04); }
.bl-client-item.active { background: var(--accent-dim); }
.bl-client-item-name { font-size: 12px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.bl-client-item.active .bl-client-item-name { color: var(--accent-lt); }
.bl-client-item-count {
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: rgba(255,255,255,.06); border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
}
.bl-client-item.active .bl-client-item-count { background: rgba(124,58,237,.3); color: var(--accent-lt); }
.bl-client-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.bl-client-item:hover .bl-client-actions { opacity: 1; }
.bl-client-act {
  width: 16px; height: 16px; border: none; padding: 0;
  background: none; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: color .12s;
}
.bl-client-act:hover { color: var(--accent-lt); }
.bl-client-act-del:hover { color: #f87171; }
.bl-client-item.active .bl-client-act:hover { color: #fff; }
.bl-client-item.active .bl-client-act-del:hover { color: #fff; }

/* Main */
.bl-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Toolbar */
.bl-toolbar {
  padding: 10px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.bl-toolbar-name { font-size: 14px; font-weight: 700; }
.bl-toolbar-count { font-size: 12px; color: var(--muted); }
.bl-toolbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bl-filter-sel {
  height: 28px; padding: 0 8px;
  background: rgba(26,26,46,.7); border: none;
  border-radius: 7px; color: var(--dim);
  font-family: inherit; font-size: 12px; outline: none; cursor: pointer;
}

/* ── Backlinks grid (flat CSS Grid) ───────────────────────────────────────── */
.bl-list-wrap { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.bl-list-wrap::-webkit-scrollbar { width: 6px; }
.bl-list-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.bl-grid-inner {
  display: grid;
  grid-template-columns:
    26px                        /* checkbox         */
    minmax(max-content, 1fr)    /* cliente          */
    minmax(max-content, 1fr)    /* obs. interna     */
    minmax(max-content, .8fr)   /* mês              */
    minmax(max-content, 1fr)    /* situação         */
    minmax(max-content, 1fr)    /* qualidade        */
    minmax(max-content, .8fr)   /* responsável      */
    minmax(max-content, .8fr)   /* data postagem    */
    minmax(160px, 2fr)          /* postado em       */
    minmax(160px, 2fr)          /* apontado para    */
    minmax(max-content, 1fr)    /* palavra-chave    */
    minmax(max-content, 1fr)    /* observação       */
    minmax(max-content, 1fr);   /* histórico        */
  min-width: 100%;
  background: rgba(12,16,26,.5);
  border-radius: 12px;
}

/* Expand button */
.bl-expand-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 2px; display: flex; align-items: center; justify-content: center; transition: color .15s, transform .2s; border-radius: 4px; }
.bl-expand-btn:hover { color: var(--accent-lt); }
.bl-row-expanded { transform: rotate(90deg); color: var(--accent-lt); }

/* Detail panel */
.bl-row-detail { display: none; background: rgba(159,103,255,.04); border-top: 1px solid rgba(255,255,255,.06); padding: 14px 16px 14px 56px; }
.bl-row-detail.open { display: block; }
.bl-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; }
.bl-detail-item { display: flex; flex-direction: column; gap: 4px; }
.bl-detail-label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.bl-detail-value { font-size: 12px; color: var(--text); }

/* Header cells */
.bl-ghdr {
  position: sticky; top: 0; z-index: 2;
  background: rgba(12,16,26,.95);
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
  padding: 10px 8px; white-space: nowrap;
  justify-content: center;
}

/* Grid cliente (sem Obs. Interna e Qualidade) */
.bl-grid-inner.bl-grid-cliente {
  grid-template-columns:
    26px                        /* checkbox         */
    minmax(max-content, 1fr)    /* cliente          */
    minmax(max-content, .8fr)   /* mês              */
    minmax(max-content, 1fr)    /* situação         */
    minmax(max-content, .8fr)   /* responsável      */
    minmax(max-content, .8fr)   /* data postagem    */
    minmax(160px, 2fr)          /* postado em       */
    minmax(160px, 2fr)          /* apontado para    */
    minmax(max-content, 1fr)    /* palavra-chave    */
    minmax(max-content, 1fr)    /* observação       */
    minmax(max-content, 1fr);   /* histórico        */
}

/* Month blocks */
.bl-month-block { margin-bottom: 20px; overflow-x: auto; }
.bl-month-block:last-child { margin-bottom: 0; }
.bl-month-block::-webkit-scrollbar { height: 3px; }
.bl-month-block::-webkit-scrollbar-track { background: transparent; }
.bl-month-block::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.bl-month-block::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }
.bl-month-title {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 8px;
}
.bl-month-title-label {
  font-size: 13px; font-weight: 800; color: var(--text);
}
.bl-month-title-sub {
  font-size: 11px; color: var(--muted); font-weight: 500;
}
.bl-month-title-count {
  font-size: 11px; font-weight: 700;
  background: var(--accent-dim); color: var(--accent-lt);
  padding: 2px 8px; border-radius: 5px;
}
/* Botão recolher mês */
.bl-month-collapse-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 2px; display: flex;
  align-items: center; justify-content: center;
  transition: color .15s, transform .2s; border-radius: 4px;
  transform: rotate(0deg);
  flex-shrink: 0;
}
.bl-month-collapse-btn.bl-month-open { transform: rotate(90deg); }
.bl-month-collapse-btn:hover { color: var(--accent-lt); }
.bl-collapse-char { font-size: 16px; line-height: 1; font-weight: 400; display: block; }
.bl-month-block.bl-month-collapsed .bl-grid-inner { display: none; }

/* Base cell */
.bl-gcol { padding: 9px 8px; min-width: 0; display: flex; align-items: center; justify-content: center; }
.bl-gcol-cb { padding-left: 6px; padding-right: 4px; }
.bl-gcol-center { justify-content: center; }
.bl-gcol-lim { max-width: 160px; }
.bl-gcol-link { min-width: 0; overflow: hidden; justify-content: flex-start; }
.bl-gcol-link .bl-cell-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }

/* Row states (applied per-cell in flat grid) */
.bl-gdata { min-height: 40px; transition: background .1s; cursor: default; }
.bl-row-even { background: rgba(255,255,255,.022); }
.bl-gdata:not(.bl-row-even) { background: rgba(255,255,255,.006); }
.bl-row-hover { background: rgba(159,103,255,.07) !important; }
.bl-row-selected { background: rgba(52,211,153,.06) !important; }
.bl-row-selected.bl-row-hover { background: rgba(52,211,153,.1) !important; }

/* Conteúdo das células */
.bl-gc-cliente { font-size: 12px; font-weight: 600; color: var(--dim); white-space: nowrap; text-align: center; }
.bl-gc-obsi    { font-size: 12px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; }
.bl-gc-mes     { font-size: 12px; color: var(--dim); white-space: nowrap; text-align: center; }
.bl-gc-data    { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: center; }
.bl-gc-obs     { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; }
.bl-link-ico   { color: var(--muted); flex-shrink: 0; }
.bl-list-hist  { cursor: pointer; }
.bl-list-hist:hover .bl-hist-cell { opacity: .8; }

/* Custom checkboxes — idêntico ao .hist-cb */
.bl-row-check, #bl-check-all {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
  background: #1a2438; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; transition: background .15s;
  vertical-align: middle;
}
.bl-row-check::after, #bl-check-all::after {
  content: '';
  display: block;
  width: 10px; height: 7px;
  border-left: 2px solid #34d399;
  border-bottom: 2px solid #34d399;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0; transition: opacity .15s;
}
.bl-row-check:checked, #bl-check-all:checked { background: rgba(16,185,129,.15); }
.bl-row-check:checked::after, #bl-check-all:checked::after { opacity: 1; }
#bl-check-all:indeterminate { background: rgba(16,185,129,.08); }
#bl-check-all:indeterminate::after {
  width: 10px; height: 2px; border-left: none;
  border-bottom: 2px solid #34d399; transform: none; opacity: 1;
}
.bl-check-all-label { display: flex; align-items: center; cursor: pointer; }

/* Cell types */
.bl-cell { font-size: 12px; color: var(--text); max-width: 170px; overflow: hidden; text-overflow: ellipsis; display: block; }
.bl-cell-muted { font-size: 12px; color: var(--muted); font-style: italic; }
.bl-cell-empty-obs { display: flex; align-items: center; justify-content: center; width: 100%; color: var(--muted); opacity: .45; transition: color .15s, opacity .15s; }
.bl-cell-editable:hover .bl-cell-empty-obs { color: var(--accent-lt); opacity: 1; }
.bl-gc-data svg, .bl-list-kw svg { transition: opacity .15s, color .15s; }
.bl-gc-data.bl-cell-editable:hover svg,
.bl-list-kw.bl-cell-editable:hover svg { opacity: 1 !important; color: var(--accent-lt); }
.bl-cell-editable:has(.bl-cell-empty-obs):hover { background: transparent; }
.bl-cell-empty-link { display: flex; align-items: center; justify-content: center; width: 100%; color: var(--muted); opacity: .45; transition: color .15s, opacity .15s; }
.bl-cell-empty-link::before { content: ''; display: inline-block; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 15l6 -6'/%3E%3Cpath d='M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464'/%3E%3Cpath d='M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 15l6 -6'/%3E%3Cpath d='M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464'/%3E%3Cpath d='M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463'/%3E%3C/svg%3E") center/contain no-repeat; }
.bl-cell-link-col:hover .bl-cell-empty-link { color: var(--accent-lt); opacity: 1; }
.bl-cell-link-col:has(.bl-cell-empty-link):hover { background: transparent; }
.bl-cell-empty-obs::before { content: ''; display: inline-block; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h6'/%3E%3Cpath d='M12.5 20.5l-.5 .5l-3 -3h-3a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5'/%3E%3Cpath d='M16 19h6'/%3E%3Cpath d='M19 16v6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h6'/%3E%3Cpath d='M12.5 20.5l-.5 .5l-3 -3h-3a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5'/%3E%3Cpath d='M16 19h6'/%3E%3Cpath d='M19 16v6'/%3E%3C/svg%3E") center/contain no-repeat; }
.bl-cell-link { font-size: 12px; color: var(--accent-lt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; flex: 1; min-width: 0; }
.bl-cell-link:hover { text-decoration: none; }
.bl-cell-date { font-size: 12px; color: var(--dim); }
.bl-cell-kw { font-size: 11px; background: rgba(124,58,237,.15); color: var(--accent-lt); padding: 2px 8px; border-radius: 5px; display: inline-block; }
.bl-obs-interna { font-size: 11px; color: var(--dim); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.bl-hist-clickable { cursor: pointer; }
.bl-hist-clickable:hover .bl-hist-cell { opacity: .8; }
.bl-hist-cell { display: flex; flex-direction: column; gap: 1px; }
.bl-hist-avatar-wrap { flex-direction: row; align-items: center; gap: 6px; }
.bl-hist-action { font-size: 11px; color: var(--text); }
.bl-hist-meta { font-size: 10px; color: var(--muted); }
.bl-hist-badge { font-size: 9px; font-weight: 700; color: var(--accent-lt); background: rgba(124,58,237,.18); border-radius: 4px; padding: 1px 5px; display: inline-block; }

/* Popover histórico */
.bl-hist-popover {
  position: fixed; z-index: 9998; display: none;
  width: 240px; background: var(--card);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.6);
  padding: 6px 0; max-height: 320px; overflow-y: auto;
}
.bl-hist-popover.open { display: block; }
.bl-hist-pop-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 14px 4px; }
.bl-hist-pop-entry { padding: 6px 14px; border-top: 1px solid rgba(255,255,255,.04); }
.bl-hist-pop-text { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.bl-hist-pop-meta { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.bl-hist-pop-empty { padding: 10px 14px; font-size: 12px; color: var(--muted); }

/* Status badges */
.bl-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; user-select: none; }
.bl-status:hover { opacity: .8; }
.bl-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Qualidade */
.bl-qual { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; cursor: pointer; user-select: none; }
.bl-qual:hover { opacity: .8; }
.bl-qual-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Header gear button (opções de dropdown) */
.bl-hdr-gear { background: none; border: none; padding: 0 0 0 4px; cursor: pointer; color: var(--muted); opacity: 0; transition: opacity .15s, color .15s; vertical-align: middle; line-height: 0; }
.bl-ghdr:hover .bl-hdr-gear { opacity: .6; }
.bl-hdr-gear:hover { color: var(--accent-lt) !important; opacity: 1 !important; }

/* Header rename button (três pontinhos) */
.bl-hdr-rename-btn { background: none; border: none; padding: 0 0 0 4px; cursor: pointer; color: var(--muted); opacity: 0; transition: opacity .15s, color .15s; vertical-align: middle; line-height: 0; }
.bl-ghdr:hover .bl-hdr-rename-btn { opacity: .6; }
.bl-hdr-rename-btn:hover { color: var(--accent-lt) !important; opacity: 1 !important; }

/* Header column rename input */
.bl-hdr-rename-input { background: none; border: none; border-bottom: 1px solid var(--accent-lt); color: inherit; font: inherit; font-size: 11px; font-weight: 700; padding: 0; outline: none; min-width: 40px; max-width: 120px; }

/* Modal de edição de opções */
.bl-opts-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.bl-opts-box { background: var(--card-bg, #131929); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 0; min-width: 320px; max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.bl-opts-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 13px; font-weight: 700; color: var(--text); }
.bl-opts-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 2px; display: flex; align-items: center; transition: color .15s; }
.bl-opts-close:hover { color: var(--text); }
.bl-opts-list { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.bl-opts-row { display: flex; align-items: center; gap: 10px; }
.bl-opts-color { width: 30px; height: 30px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); padding: 2px; cursor: pointer; background: transparent; flex-shrink: 0; }
.bl-opts-label { flex: 1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 6px 10px; font-size: 12px; color: var(--text); outline: none; transition: border-color .15s; }
.bl-opts-label:focus { border-color: var(--accent-lt, #9f67ff); }
.bl-opts-del-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; display: flex; align-items: center; border-radius: 5px; flex-shrink: 0; transition: color .15s, background .15s; }
.bl-opts-del-btn:hover { color: #f87171; background: rgba(248,113,113,.12); }
.bl-opts-add-row { padding: 4px 18px 10px; }
.bl-opts-add-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.15); border-radius: 7px; padding: 6px 14px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s; width: 100%; justify-content: center; }
.bl-opts-add-btn:hover { color: var(--accent-lt, #9f67ff); border-color: var(--accent-lt, #9f67ff); background: rgba(159,103,255,.07); }
.bl-opts-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.bl-opts-cancel { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; padding: 7px 16px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s; }
.bl-opts-cancel:hover { background: rgba(255,255,255,.1); }
.bl-opts-save { background: var(--accent, #7c3aed); border: none; border-radius: 7px; padding: 7px 18px; font-size: 12px; font-weight: 700; color: #fff; cursor: pointer; transition: opacity .15s; }
.bl-opts-save:hover { opacity: .85; }

/* Responsável */
.bl-resp { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; width: 100%; }
.bl-resp:hover { opacity: .8; }
.bl-resp-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent-lt);
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden;
}
.bl-resp-avatar img, .bl-resp-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bl-resp-avatar.bl-resp-emoji { background: none; color: var(--muted); opacity: .45; transition: color .15s, opacity .15s; }
.bl-gdata:hover .bl-resp-avatar.bl-resp-emoji { color: var(--accent-lt); opacity: 1; }
.bl-icon-empty { color: var(--muted); opacity: .45; transition: color .15s, opacity .15s; }
.bl-cell-editable:hover .bl-icon-empty { color: var(--accent-lt); opacity: 1; }

/* Edição inline de células */
.bl-cell-editable { cursor: text; }
.bl-cell-link-col { cursor: default; width: 100%; overflow: hidden; min-width: 0; }
.bl-cell-link-col.bl-cell-editable { cursor: pointer; }
.bl-cell-link-col.bl-cell-editable:empty:hover, .bl-cell-link-col.bl-cell-editable .bl-cell-muted { cursor: text; }
.bl-inline-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--accent); border-radius: 4px;
  padding: 3px 6px; font-size: 12px; font-family: inherit;
  outline: none;
}
.bl-cell-link-preview { color: var(--accent-lt); font-size: 12px; }

/* Mês picker */
.bl-mes-picker { display: flex; align-items: center; gap: 4px; }
.bl-mes-sel {
  background: var(--bg); color: var(--text); border: 1px solid var(--accent);
  border-radius: 4px; font-size: 12px; font-family: inherit;
  padding: 2px 4px; outline: none; cursor: pointer;
}
.bl-mes-year {
  width: 52px; background: var(--bg); color: var(--text);
  border: 1px solid var(--accent); border-radius: 4px;
  font-size: 12px; font-family: inherit; padding: 2px 4px; outline: none;
  -moz-appearance: textfield;
}
.bl-mes-year::-webkit-inner-spin-button, .bl-mes-year::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Add row */
.bl-add-row-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; color: var(--accent-lt); font-size: 12px; font-weight: 600;
  cursor: pointer; background: rgba(124,58,237,.08); font-family: inherit;
  transition: color .15s, border-color .15s, background .15s;
  margin: 6px 12px 4px; width: calc(100% - 24px);
  border: 1.5px dashed rgba(124,58,237,.55);
  border-radius: 8px;
}
.bl-add-row-btn:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

/* Dropdown */
.bl-dropdown {
  position: fixed; z-index: 9999;
  background: #1a1a2e; border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  display: none; flex-direction: column; gap: 2px; min-width: 160px;
}
.bl-dropdown.open { display: flex; }
.bl-dropdown-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px;
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text);
  transition: background .12s; font-family: inherit; background: none; border: none; width: 100%; text-align: left;
}
.bl-dropdown-opt:hover { background: rgba(255,255,255,.06); }
.bl-dropdown-opt.selected { background: rgba(124,58,237,.15); }
.bl-dd-disabled { opacity: .35; pointer-events: none; }
.bl-dropdown-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
