/* ==========================================================================
   Inpyx Coletor — Design System (light/dark global toggle)
   Vanilla CSS · navbar moderna · Dashboard analítico · Scraper "app store"
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; }

/* ---------- Tokens de tema ---------- */
:root {
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --nav-h: 68px;
  --accent: #10b981;
  --accent-soft: #6ee7b7;
  --accent-ghost: rgba(16,185,129,.12);
  --accent-on: #ffffff;
  --ok: #10b981; --bad: #ef4444; --warn: #f59e0b; --info: #3b82f6; --purple: #a855f7;
  --c1:#10b981; --c2:#3b82f6; --c3:#a855f7; --c4:#f59e0b; --c5:#ef4444; --c6:#06b6d4; --c7:#ec4899; --c8:#84cc16;
  transition: background-color .25s ease, color .25s ease;
}

html[data-theme="light"] {
  --bg: #eef1f5;
  --bg-2: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --nav-bg: rgba(255,255,255,.85);
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e6eaf0;
  --border-strong: #d6dce6;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 48px -16px rgba(15,23,42,.20);
  --accent: #10b981; --accent-soft:#34d399; --accent-ghost: rgba(16,185,129,.10); --accent-on:#ffffff;
}

html[data-theme="dark"] {
  --bg: #08090b;
  --bg-2: #0d0e11;
  --surface: #141518;
  --surface-2: #1b1d22;
  --nav-bg: rgba(15,16,19,.82);
  --text: #f4f4f5;
  --text-2: #c4c7cf;
  --muted: #8a8f99;
  --border: #24262c;
  --border-strong: #32353d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 30px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.7);
  --accent: #bef264; --accent-soft:#a3e635; --accent-ghost: rgba(190,242,100,.14); --accent-on:#0a0a0a;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.hidden { display: none !important; }

/* ============================ NAVBAR ============================ */
.navbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; gap: 24px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; color: var(--accent-on);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  box-shadow: 0 6px 16px -4px var(--accent-ghost);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand-dot { color: var(--accent); }

.nav-pills { display: flex; align-items: center; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 999px; border: 1px solid var(--border); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: none; cursor: pointer;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all .18s ease; white-space: nowrap;
}
.pill .icon { width: 16px; height: 16px; }
.pill:hover { color: var(--text); }
.pill.active { background: var(--accent); color: var(--accent-on); box-shadow: 0 4px 12px -3px var(--accent-ghost); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0 14px; height: 40px; border-radius: 999px; color: var(--muted);
  transition: all .18s ease;
}
.nav-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ghost); }
.nav-search .icon { width: 16px; height: 16px; }
.nav-search input { border: none; background: none; outline: none; color: var(--text); font-size: 13px; width: 180px; }
.nav-search input::placeholder { color: var(--muted); }

.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: all .18s ease; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle { position: relative; overflow: hidden; }
.theme-sun, .theme-moon { position: absolute; display: grid; place-items: center; transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s ease; }
html[data-theme="light"] .theme-moon { transform: translateY(140%) rotate(40deg); opacity: 0; }
html[data-theme="light"] .theme-sun { transform: translateY(0) rotate(0); opacity: 1; }
html[data-theme="dark"] .theme-sun { transform: translateY(-140%) rotate(-40deg); opacity: 0; }
html[data-theme="dark"] .theme-moon { transform: translateY(0) rotate(0); opacity: 1; }

.run-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600; font-size: 13px; background: var(--accent); color: var(--accent-on); box-shadow: 0 6px 16px -6px var(--accent-ghost); transition: all .18s ease; }
.run-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.run-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.run-btn .icon { width: 16px; height: 16px; }

.status-pill { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0 12px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-dot.online { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.busy { background: var(--warn); animation: pulse 1.4s infinite; }
.status-dot.offline { background: var(--bad); }

/* ============================ LAYOUT ============================ */
.main { max-width: 1320px; margin: 0 auto; padding: 32px 28px 64px; }
.page { animation: fadeIn .35s ease; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-family: 'Outfit', sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

.period-select, .filter-group select, .filter-group input { color: var(--text); }
.period-select { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: 0 14px; height: 42px; border-radius: var(--r); box-shadow: var(--shadow); color: var(--text-2); }
.period-select .icon { width: 16px; height: 16px; color: var(--accent); }
.period-select select { border: none; background: none; outline: none; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ============================ KPIs ============================ */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; display: flex; gap: 16px; align-items: center; box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.kpi-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.kpi-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-icon .icon { width: 22px; height: 22px; }
.i-emerald { background: rgba(16,185,129,.12); color: #10b981; }
.i-blue { background: rgba(59,130,246,.12); color: #3b82f6; }
.i-purple { background: rgba(168,85,247,.12); color: #a855f7; }
.i-amber { background: rgba(245,158,11,.14); color: #f59e0b; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; line-height: 1.1; margin: 2px 0; }
.kpi-trend { font-size: 11px; color: var(--muted); }

/* ============================ PAINÉIS / GRÁFICOS ============================ */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.panel-head h2 { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; }
.panel-head p { font-size: 13px; color: var(--text-2); margin-top: 3px; }

.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw-found { background: var(--c2); }
.sw-new { background: var(--accent); }

.chart-wrap { width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 48px; text-align: center; color: var(--muted); font-size: 14px; }

.bar { transition: opacity .15s ease; cursor: pointer; }
.bar:hover { opacity: .8; }
.bar-grid { stroke: var(--border); stroke-width: 1; }
.bar-axis { fill: var(--muted); font-size: 11px; font-family: 'Inter', sans-serif; }

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.dash-bottom .panel { margin-bottom: 0; }

.donut-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-wrap { width: 180px; flex-shrink: 0; }
.donut-wrap svg { width: 100%; height: auto; }
.donut-center-num { font-family: 'Outfit', sans-serif; font-weight: 800; fill: var(--text); }
.donut-center-lbl { fill: var(--muted); font-size: 11px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 160px; }
.dl-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dl-swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.dl-label { color: var(--text-2); flex: 1; }
.dl-value { font-weight: 700; color: var(--text); }
.dl-pct { color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }

.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.rank-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-size: 13px; font-weight: 700; color: var(--text-2); }
.rank-bar { grid-column: 1 / -1; height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); }

/* ============================ FILTROS / CURADORIA ============================ */
.filter-panel { padding: 22px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 16px; }
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-group label { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.filter-group label .icon { width: 14px; height: 14px; color: var(--accent); }
.filter-group input, .filter-group select { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); font-size: 13px; outline: none; transition: all .18s ease; }
.filter-group input:focus, .filter-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ghost); }
.filter-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.filter-count { font-size: 13px; color: var(--text-2); font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--r); font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .18s ease; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: var(--r-sm); }
.btn-primary { background: var(--accent); color: var(--accent-on); box-shadow: 0 6px 16px -6px var(--accent-ghost); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.article-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; cursor: pointer; transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s ease, border-color .25s ease; }
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.article-thumb { height: 172px; position: relative; background: var(--surface-2); overflow: hidden; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.article-card:hover .article-thumb img { transform: scale(1.06); }
.thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); gap: 6px; background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); }
.thumb-ph .icon { width: 34px; height: 34px; }
.badge-cat { position: absolute; top: 12px; left: 12px; background: var(--accent); color: var(--accent-on); padding: 4px 10px; border-radius: var(--r-sm); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; z-index: 2; }
.article-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.article-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.article-meta span { display: inline-flex; align-items: center; gap: 4px; }
.article-meta .icon { width: 12px; height: 12px; }
.article-title { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-summary { font-size: 13px; color: var(--text-2); line-height: 1.55; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.article-src-row { display: flex; justify-content: space-between; align-items: center; }
.article-src { font-size: 12px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; overflow: hidden; }
.article-src .icon { width: 13px; height: 13px; }
.lang-badge { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; text-transform: uppercase; color: var(--text-2); }
.cluster-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 11px; color: var(--muted); }
.cluster-badge { font-size: 10px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text-2); }

/* ============================ ESTADOS ============================ */
.state-block { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; text-align: center; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 18px; }
.state-icon { color: var(--muted); margin-bottom: 16px; }
.state-icon .icon { width: 54px; height: 54px; }
.state-block h3 { font-family: 'Outfit', sans-serif; font-size: 20px; margin-bottom: 6px; }
.state-block p { color: var(--text-2); font-size: 14px; max-width: 380px; }

/* ============================ SCRAPER ============================ */
.scraper-summary { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; margin-bottom: 22px; }
.summary-main { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.summary-main.success { border-left-color: var(--ok); }
.summary-main.partial { border-left-color: var(--warn); }
.summary-main.failed { border-left-color: var(--bad); }
.summary-main.running { border-left-color: var(--info); }
.summary-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.summary-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: var(--muted); }
.summary-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.summary-main.success .summary-badge { color: var(--ok); background: rgba(16,185,129,.12); }
.summary-main.partial .summary-badge { color: var(--warn); background: rgba(245,158,11,.14); }
.summary-main.failed .summary-badge { color: var(--bad); background: rgba(239,68,68,.12); }
.summary-main.running .summary-badge { color: var(--info); background: rgba(59,130,246,.12); }
.summary-main h3 { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.summary-main p { font-size: 13px; color: var(--text-2); }
.summary-mini { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.mini-label { font-size: 11px; color: var(--text-2); display: block; margin-bottom: 4px; }
.mini-value { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 800; }
.mini-value.ok { color: var(--ok); } .mini-value.bad { color: var(--bad); } .mini-value.info { color: var(--info); }

.collecting-banner { background: var(--accent-ghost); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.collecting-banner .pulse-ring { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); position: relative; flex-shrink: 0; }
.collecting-banner .pulse-ring::after { content:''; position:absolute; inset:0; border-radius:50%; background: inherit; animation: ring 1.5s cubic-bezier(.24,0,.38,1) infinite; }
.banner-text { flex: 1; min-width: 220px; }
.banner-text h4 { font-family: 'Outfit', sans-serif; font-size: 15px; margin-bottom: 3px; }
.banner-text p { font-size: 13px; color: var(--text-2); }
.progress-track { width: 100%; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; width: 40%; background: var(--accent); border-radius: 99px; animation: slide 1.8s ease-in-out infinite; }

.store-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; margin-bottom: 22px; }
.store-filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow); align-self: start; position: sticky; top: calc(var(--nav-h) + 20px); }
.store-filter-title { display: flex; justify-content: space-between; align-items: center; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 14px; padding: 6px 10px 12px; }
.store-filter-title .icon { width: 15px; height: 15px; color: var(--muted); }
.store-filter-sep { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; padding: 14px 10px 6px; }
.store-filter { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; background: none; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); transition: all .15s ease; }
.store-filter .icon { width: 16px; height: 16px; }
.store-filter:hover { background: var(--surface-2); color: var(--text); }
.store-filter.active { background: var(--accent); color: var(--accent-on); }
.ff-count { margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(127,127,127,.18); padding: 1px 8px; border-radius: 99px; }
.store-filter.active .ff-count { background: rgba(0,0,0,.18); }

.store-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.store-head h2 { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; }
.store-sub { font-size: 13px; color: var(--muted); }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

.source-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 14px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.source-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.source-card-top { display: flex; gap: 12px; align-items: flex-start; }
.source-avatar { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 20px; color: #fff; flex-shrink: 0; }
.source-card-title { flex: 1; min-width: 0; }
.source-card-title h4 { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source-card-title .slug { font-size: 11px; color: var(--muted); }
.type-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.type-chip.rss { background: rgba(249,115,22,.14); color: #f97316; }
.type-chip.html { background: rgba(59,130,246,.14); color: #3b82f6; }
.source-card-metrics { display: flex; gap: 8px; }
.metric-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 10px; border-radius: 99px; }
.metric-chip .icon { width: 13px; height: 13px; color: var(--accent); }
.metric-chip strong { color: var(--text); }
.source-card-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.src-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; }
.src-status::before { content:''; width: 7px; height: 7px; border-radius: 50%; }
.src-status.ok { color: var(--ok); } .src-status.ok::before { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.src-status.failed { color: var(--bad); } .src-status.failed::before { background: var(--bad); }
.src-status.blocked_robots { color: var(--warn); } .src-status.blocked_robots::before { background: var(--warn); }
.src-status.standby { color: var(--muted); } .src-status.standby::before { background: var(--muted); }
.robots-mini { font-size: 10px; color: var(--muted); }
.robots-mini strong.allow { color: var(--ok); } .robots-mini strong.block { color: var(--bad); }

/* ---- Source modal ---- */
.source-modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.source-modal-head .source-avatar { width: 52px; height: 52px; }
.source-modal-slug { font-size: 12px; color: var(--muted); }
.source-status-pill { margin-left: auto; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: var(--surface-2); }
.source-status-pill.ok { color: var(--ok); background: rgba(16,185,129,.12); }
.source-status-pill.failed { color: var(--bad); background: rgba(239,68,68,.12); }
.source-status-pill.blocked_robots { color: var(--warn); background: rgba(245,158,11,.14); }
.source-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.source-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; text-align: center; }
.source-stat .v { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; }
.source-stat .l { font-size: 11px; color: var(--muted); }
.source-detail-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.sd-row { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.sd-row .k { color: var(--text-2); }
.sd-row .vv { font-weight: 600; text-align: right; }
.sd-row .vv.err { color: var(--bad); }

/* ============================ TABELA RUNS ============================ */
.runs-panel { padding: 0; overflow: hidden; }
.runs-panel .panel-head { padding: 24px 24px 0; }
.table-wrap { overflow-x: auto; }
.runs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.runs-table th { text-align: left; padding: 14px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.runs-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.runs-table tr:last-child td { border-bottom: none; }
.runs-table tr:hover td { background: var(--surface-2); }
.runs-table strong { color: var(--text); }
.runs-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.runs-pill.success { background: rgba(16,185,129,.12); color: var(--ok); }
.runs-pill.partial { background: rgba(245,158,11,.14); color: var(--warn); }
.runs-pill.failed { background: rgba(239,68,68,.12); color: var(--bad); }
.runs-pill.running { background: rgba(59,130,246,.12); color: var(--info); }
.pos { color: var(--ok); font-weight: 700; }
.loading-td { text-align: center; padding: 40px !important; color: var(--muted); }

/* ============================ MODAIS ============================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.55); backdrop-filter: blur(7px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .2s ease; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); animation: scaleUp .28s cubic-bezier(.34,1.56,.64,1); }
.modal-sm { max-width: 480px; }
.modal-lg { max-width: 820px; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(127,127,127,.18); color: var(--text); display: grid; place-items: center; cursor: pointer; z-index: 5; transition: all .18s ease; }
.modal-close:hover { background: var(--bad); color: #fff; }
.modal-banner { height: 230px; background: var(--surface-2); overflow: hidden; border-radius: var(--r-xl) var(--r-xl) 0 0; }
.modal-banner img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 30px; }
.modal-meta-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-category { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.modal-time { font-size: 12px; color: var(--muted); }
.modal-title { font-family: 'Outfit', sans-serif; font-size: 23px; font-weight: 800; line-height: 1.3; margin-bottom: 18px; }
.modal-title-sm { font-family: 'Outfit', sans-serif; font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.modal-subtitle { font-size: 13px; color: var(--muted); display: block; margin-bottom: 22px; }
.modal-authors { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-authors span { display: inline-flex; align-items: center; gap: 6px; }
.modal-authors .icon { width: 14px; height: 14px; }
.modal-ai { background: var(--accent-ghost); border: 1px solid var(--accent); border-radius: var(--r); padding: 18px; margin-bottom: 22px; }
.modal-ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.modal-ai-head .icon { width: 18px; height: 18px; color: var(--accent); }
.modal-ai-head h3 { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; flex: 1; }
.ai-badge { font-size: 9px; font-weight: 800; background: var(--accent); color: var(--accent-on); padding: 2px 6px; border-radius: 5px; }
.modal-ai-body { font-size: 14px; line-height: 1.65; color: var(--text); }
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.modal-tag { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 6px; font-weight: 500; color: var(--text-2); }
.modal-cluster { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.modal-cluster h3 { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.cluster-list { display: flex; flex-direction: column; gap: 8px; }
.cluster-item { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border: 1px solid var(--border); padding: 10px 14px; border-radius: var(--r); font-size: 12px; }
.cluster-item .ci-name { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.cluster-item .ci-name .icon { width: 12px; height: 12px; }
.cluster-item .ci-date { color: var(--muted); margin-left: 8px; font-weight: 400; }
.cluster-item a { color: var(--accent); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.cluster-item a:hover { text-decoration: underline; }
.cluster-item a .icon { width: 12px; height: 12px; }
.modal-details { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.modal-details summary { padding: 12px 16px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--surface-2); }
.details-content { padding: 16px; font-size: 13px; line-height: 1.6; color: var(--text-2); border-top: 1px solid var(--border); }
.report-box { background: #0b0f10; border: 1px solid #1e2528; border-radius: var(--r); padding: 20px; overflow: auto; max-height: 55vh; margin-top: 8px; }
.report-box pre { font-family: 'Courier New', monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; color: #a3e635; }

/* ============================ ANIMAÇÕES ============================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleUp { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.4);} 70% { box-shadow: 0 0 0 6px rgba(245,158,11,0);} 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0);} }
@keyframes ring { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ============================ RESPONSIVO ============================ */
@media (max-width: 1080px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom { grid-template-columns: 1fr; }
  .scraper-summary { grid-template-columns: 1fr; }
  .store-layout { grid-template-columns: 1fr; }
  .store-filters { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
  .store-filter-title, .store-filter-sep { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .navbar { padding: 0 16px; gap: 12px; }
  .nav-left { gap: 12px; }
  .nav-pills .pill { padding: 9px 12px; }
  .nav-pills .pill .pill-label { display: none; }
  .nav-search { display: none; }
  .run-btn-label { display: none; }
  #system-status-text { display: none; }
  .status-pill { padding: 0 10px; width: 40px; justify-content: center; }
  .filter-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
  .main { padding: 22px 16px 48px; }
  .page-head h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .navbar { gap: 8px; }
}

