/* ===========================================================================
   GARIMPO — painel de espionagem de anuncios. Design: dark premium / terminal
   de inteligencia. Acento violeta eletrico, verde-neon reservado pra ATIVO.
   Tipografia self-hosted (CSP default-src 'self' proibe fonte externa).
   =========================================================================== */

/* ---- fontes ---- */
@font-face { font-family:'Clash Display'; font-weight:600; font-display:swap; src:url('/assets/fonts/ClashDisplay-600.woff2') format('woff2'); }
@font-face { font-family:'Clash Display'; font-weight:700; font-display:swap; src:url('/assets/fonts/ClashDisplay-700.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-weight:400; font-display:swap; src:url('/assets/fonts/HankenGrotesk-400.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-weight:500; font-display:swap; src:url('/assets/fonts/HankenGrotesk-500.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-weight:600; font-display:swap; src:url('/assets/fonts/HankenGrotesk-600.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-weight:700; font-display:swap; src:url('/assets/fonts/HankenGrotesk-700.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-weight:500; font-display:swap; src:url('/assets/fonts/JetBrainsMono-500.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-weight:700; font-display:swap; src:url('/assets/fonts/JetBrainsMono-700.woff2') format('woff2'); }

/* ---- tokens ---- */
:root {
  --bg:        #07060c;
  --bg-2:      #0b0a13;
  --surface:   #12111d;
  --surface-2: #17162595;
  --raised:    #1b1a2b;
  --hover:     #201f34;
  --line:      rgba(163,150,230,0.10);
  --line-2:    rgba(163,150,230,0.18);

  --txt:   #f3f1fb;
  --txt-2: #bcb7db;
  --txt-3: #8b86ab;

  --violet:        #7c5cff;
  --violet-bright: #a68bff;
  --violet-deep:   #5b3fd6;
  --magenta:       #e15ce8;
  --green:         #34f5a8;   /* reservado: ATIVO */
  --green-deep:    #0f2f24;
  --amber:         #f7b13c;
  --rose:          #ff6584;
  --slate:         #6c7194;

  --font-display: 'Clash Display', 'Hanken Grotesk', sans-serif;
  --font-ui: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sidebar-w: 244px;
  --shadow: 0 24px 60px -20px rgba(0,0,0,0.75);
  --glow-violet: 0 0 0 1px rgba(124,92,255,0.35), 0 8px 30px -8px rgba(124,92,255,0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--txt);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* atmosfera: grid sutil + brilho radial violeta no topo */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 72% -8%, rgba(124,92,255,0.16), transparent 60%),
    radial-gradient(900px 500px at 8% 4%, rgba(225,92,232,0.08), transparent 55%),
    var(--bg);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(163,150,230,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(163,150,230,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(1100px 700px at 60% 0%, #000 30%, transparent 85%);
          mask-image: radial-gradient(1100px 700px at 60% 0%, #000 30%, transparent 85%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(124,92,255,0.4); color: #fff; }

:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 2px; border-radius: 4px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2a2842 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #26243c; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #35325a; background-clip: content-box; }

/* ===========================================================================
   LOGIN
   =========================================================================== */
body[data-page="login"] { display: grid; place-items: center; padding: 24px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  background: linear-gradient(180deg, rgba(30,28,48,0.7), rgba(18,17,29,0.85));
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 40px 34px 34px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  animation: rise 0.7s var(--ease) both;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--magenta), transparent);
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 11px; margin-bottom: 26px;
}
.brand-glyph {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, var(--violet), var(--magenta));
  box-shadow: 0 6px 20px -6px var(--violet);
  position: relative;
}
.brand-glyph::after {
  content: ""; position: absolute; inset: 9px; border-radius: 4px;
  background: var(--bg); clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(0deg);
}
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.02em; }
.brand-word b { color: var(--violet-bright); font-weight: 700; }
.login-title { font-family: var(--font-display); font-weight: 600; font-size: 27px; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-sub { color: var(--txt-2); margin: 0 0 26px; font-size: 14.5px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 7px; font-weight: 600; }
.input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--txt);
  background: rgba(8,7,14,0.6); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: var(--txt-3); }
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,0.18); background: rgba(8,7,14,0.85); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; border-radius: var(--r); color: var(--txt);
  background: var(--raised); transition: transform 0.12s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(140deg, var(--violet), var(--violet-deep));
  border-color: rgba(166,139,255,0.4); color: #fff;
  box-shadow: 0 10px 26px -12px var(--violet);
}
.btn-primary:hover { background: linear-gradient(140deg, var(--violet-bright), var(--violet)); }
.btn-block { width: 100%; margin-top: 8px; }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }

.form-error { color: var(--rose); font-size: 13.5px; margin: 4px 0 0; min-height: 1px; }

/* ===========================================================================
   APP SHELL
   =========================================================================== */
body[data-page="app"] { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 16px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,15,26,0.6), rgba(9,8,15,0.4));
  backdrop-filter: blur(6px);
}
.sidebar .brand-mark { padding: 0 8px; margin-bottom: 30px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r);
  color: var(--txt-2); font-weight: 500; font-size: 14.5px; width: 100%; background: transparent;
  border: 1px solid transparent; text-align: left; transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item:hover { background: var(--surface-2); color: var(--txt); }
.nav-item.active { background: linear-gradient(120deg, rgba(124,92,255,0.16), rgba(124,92,255,0.04)); color: #fff; border-color: var(--line-2); }
.nav-item.active svg { opacity: 1; color: var(--violet-bright); }
.nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); background: var(--surface-2); padding: 2px 7px; border-radius: 20px; }
.nav-item.active .nav-count { color: var(--violet-bright); }

.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #fff; background: linear-gradient(145deg, var(--violet), var(--magenta)); }
.user-name { font-weight: 600; font-size: 13.5px; }
.user-role { font-size: 11px; color: var(--txt-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.link-muted { background: none; border: none; color: var(--txt-3); font-size: 12.5px; padding: 8px; margin-left: auto; }
.link-muted:hover { color: var(--rose); }

/* main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; padding: 20px 30px 16px;
  background: linear-gradient(180deg, rgba(7,6,12,0.92), rgba(7,6,12,0.68));
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.01em; margin: 0; }
.page-sub { color: var(--txt-3); font-size: 13.5px; }
.page-sub b { color: var(--violet-bright); font-family: var(--font-mono); font-weight: 500; }

/* filtros (pills) */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search {
  position: relative; flex: 1 1 260px; min-width: 200px; max-width: 420px;
}
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--txt-3); pointer-events: none; }
.search input {
  width: 100%; padding: 10px 14px 10px 38px; font-size: 14px; font-family: inherit; color: var(--txt);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 40px; transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--txt-3); }
.search input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,0.16); }

.pill {
  appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--txt-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 40px;
  padding: 9px 32px 9px 15px; transition: border-color 0.2s, color 0.2s, background 0.2s; cursor: pointer;
  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='%238b86ab' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.pill:hover { border-color: var(--violet); color: var(--txt); }
.pill:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,0.16); }
.pill option { background: var(--raised); color: var(--txt); }

/* conteudo */
.content { padding: 24px 30px 60px; flex: 1; }

/* ===========================================================================
   GRID DE ANUNCIOS + CARD
   =========================================================================== */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 20px; }

.ad-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden; cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
  animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 34ms);
}
.ad-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.ad-card:hover .ad-media img { transform: scale(1.05); }

.ad-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.ad-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.ad-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,6,12,0.85) 0%, transparent 42%); pointer-events: none; }

.ad-topbadges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; justify-content: space-between; z-index: 2; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 9px; border-radius: 30px; backdrop-filter: blur(6px);
}
.badge-ativo { color: var(--green); background: rgba(15,47,36,0.72); border: 1px solid rgba(52,245,168,0.4); }
.badge-ativo .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.8s infinite; }
.badge-inativo { color: var(--txt-3); background: rgba(20,18,32,0.7); border: 1px solid var(--line-2); }

.ad-body { padding: 14px 15px 16px; }
.ad-headline { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--txt); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.ad-adv { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.ad-adv .name { font-weight: 600; font-size: 13px; color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.age { margin-left: auto; flex: none; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--violet-bright); background: rgba(124,92,255,0.12); padding: 3px 8px; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11.5px; font-weight: 500; color: var(--txt-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px; }
.chip svg { width: 12px; height: 12px; opacity: 0.7; }
.chip-mono { font-family: var(--font-mono); font-size: 11px; }

/* botao salvar no card */
.save-btn {
  position: absolute; z-index: 3; bottom: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: var(--txt); background: rgba(20,18,32,0.66); border: 1px solid var(--line-2);
  backdrop-filter: blur(6px); transition: background 0.18s, color 0.18s, transform 0.12s, border-color 0.18s;
}
.ad-media .save-btn { bottom: 12px; }
.save-btn:hover { background: var(--hover); transform: scale(1.08); }
.save-btn svg { width: 16px; height: 16px; }
.save-btn.on { color: var(--violet-bright); border-color: var(--violet); background: rgba(124,92,255,0.18); }
.save-btn.on svg { fill: currentColor; }

/* anel de score */
.ring { position: relative; flex: none; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .track { stroke: rgba(163,150,230,0.14); }
.ring .arc { stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease); }
.ring .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .num b { font-family: var(--font-display); font-weight: 600; line-height: 1; display: block; }
.ring .num span { font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); font-family: var(--font-mono); }
.ring.elite .arc { stroke: var(--violet-bright); filter: drop-shadow(0 0 5px rgba(166,139,255,0.7)); }
.ring.elite .num b { color: var(--violet-bright); }
.ring.forte .arc { stroke: var(--violet); }
.ring.forte .num b { color: #c6b6ff; }
.ring.morno .arc { stroke: var(--amber); }
.ring.morno .num b { color: var(--amber); }
.ring.frio .arc { stroke: var(--slate); }
.ring.frio .num b { color: var(--slate); }
.ad-media .ring { position: absolute; top: 40px; right: 12px; z-index: 2; }
.ad-media .ring svg circle.bg { fill: rgba(7,6,12,0.5); }

/* skeleton */
.sk { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.sk .sk-media { aspect-ratio: 4/5; }
.sk .sk-line { height: 12px; border-radius: 6px; margin: 12px 15px; }
.sk-shimmer { position: relative; background: #16152340; overflow: hidden; }
.sk-shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(163,150,230,0.09), transparent); animation: shimmer 1.4s infinite; }

/* ===========================================================================
   NICHOS EM ALTA
   =========================================================================== */
.nicho-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.nicho-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface);
  overflow: hidden; cursor: pointer; transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i,0) * 46ms);
}
.nicho-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.nicho-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--violet), var(--magenta)); opacity: 0.85; }
.nicho-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.nicho-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.nicho-stats { display: flex; gap: 22px; }
.stat .v { font-family: var(--font-mono); font-weight: 700; font-size: 20px; color: var(--txt); }
.stat .k { font-size: 11px; color: var(--txt-3); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.nicho-bar { margin-top: 16px; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.nicho-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violet), var(--magenta)); transition: width 0.9s var(--ease); }

/* ===========================================================================
   DRAWER (detalhe)
   =========================================================================== */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(4,3,9,0.62); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 50; height: 100vh; width: min(680px, 96vw);
  background: linear-gradient(180deg, #100f1b, #0b0a12); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px -30px rgba(0,0,0,0.9); transform: translateX(100%);
  transition: transform 0.42s var(--ease); display: flex; flex-direction: column; overflow: hidden;
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head .close { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--txt-2); background: var(--surface-2); border: 1px solid var(--line); }
.drawer-head .close:hover { background: var(--hover); color: var(--txt); }
.drawer-body { overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 22px; }

.d-hero { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.d-hero .creative { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); aspect-ratio: 4/5; background: var(--bg-2); }
.d-hero .creative img { width: 100%; height: 100%; object-fit: cover; }
.d-hero-info { min-width: 0; }
.d-adv-name { font-family: var(--font-display); font-weight: 600; font-size: 23px; letter-spacing: -0.01em; margin: 0 0 8px; }
.d-hero-ring { display: flex; align-items: center; gap: 14px; margin: 14px 0 16px; }
.band-label { font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 20px; }
.band-elite { color: var(--violet-bright); background: rgba(124,92,255,0.16); border: 1px solid var(--line-2); }
.band-forte { color: #c6b6ff; background: rgba(124,92,255,0.12); border: 1px solid var(--line); }
.band-morno { color: var(--amber); background: rgba(247,177,60,0.12); border: 1px solid rgba(247,177,60,0.28); }
.band-frio { color: var(--slate); background: rgba(108,113,148,0.14); border: 1px solid var(--line); }

.sec-title { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card-box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 16px; }

/* cabecalho de secao com acao a direita (ex.: Copy + botao Copiar) */
.sec-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sec-row .sec-title { margin: 0; flex: 0 0 auto; }
.sec-row .sec-title::after { display: none; }
.sec-row .rule { flex: 1; height: 1px; background: var(--line); }
.copy-text { font-size: 14.5px; line-height: 1.65; color: var(--txt); white-space: pre-wrap; }

.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.meta-cell { background: var(--surface); padding: 12px 14px; }
.meta-cell .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--txt-3); margin-bottom: 4px; }
.meta-cell .v { font-size: 14px; font-weight: 600; color: var(--txt); word-break: break-word; }
.meta-cell .v.mono { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }

/* breakdown do score */
.score-form { font-family: var(--font-mono); font-size: 11.5px; color: var(--txt-3); background: rgba(8,7,14,0.5); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 16px; line-height: 1.6; }
.score-form b { color: var(--violet-bright); font-weight: 700; }
.bd-row { margin-bottom: 14px; }
.bd-row:last-child { margin-bottom: 0; }
.bd-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.bd-name { font-weight: 600; font-size: 13.5px; }
.bd-name small { color: var(--txt-3); font-weight: 500; font-family: var(--font-mono); font-size: 11px; margin-left: 6px; }
.bd-pts { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.bd-track { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bd-fill { height: 100%; border-radius: 8px; transition: width 1s var(--ease); }
.bd-long .bd-fill { background: linear-gradient(90deg, var(--violet-deep), var(--violet-bright)); }
.bd-vol .bd-fill { background: linear-gradient(90deg, #2b7d63, var(--green)); }
.bd-cresc .bd-fill { background: linear-gradient(90deg, #b34fb8, var(--magenta)); }
.bd-long .bd-pts { color: var(--violet-bright); }
.bd-vol .bd-pts { color: var(--green); }
.bd-cresc .bd-pts { color: var(--magenta); }

/* curva de escala */
.curve-wrap { position: relative; }
.curve-svg { width: 100%; height: 130px; display: block; overflow: visible; }
.curve-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.curve-now { font-family: var(--font-mono); font-weight: 700; font-size: 22px; color: var(--txt); }
.delta { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.delta.up { color: var(--green); background: rgba(52,245,168,0.12); }
.delta.down { color: var(--rose); background: rgba(255,101,132,0.12); }
.delta.flat { color: var(--txt-3); background: var(--surface-2); }

/* outros anuncios */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.mini { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); cursor: pointer; transition: border-color 0.2s, transform 0.2s; position: relative; }
.mini:hover { border-color: var(--line-2); transform: translateY(-2px); }
.mini .m-media { aspect-ratio: 4/5; position: relative; }
.mini .m-media img { width: 100%; height: 100%; object-fit: cover; }
.mini .m-age { position: absolute; bottom: 6px; left: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: #fff; background: rgba(7,6,12,0.7); padding: 2px 6px; border-radius: 5px; }
.mini .m-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; }
.mini .m-dot.a { background: var(--green); box-shadow: 0 0 6px var(--green); }
.mini .m-dot.i { background: var(--slate); }

.drawer-foot { flex: none; display: flex; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); background: rgba(9,8,15,0.7); }
.drawer-foot .btn { flex: 1; }

/* estado vazio */
.empty { text-align: center; padding: 80px 20px; color: var(--txt-3); }
.empty .em-glyph { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); color: var(--violet-bright); }
.empty h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--txt-2); margin: 0 0 6px; }
.empty p { margin: 0; font-size: 14px; }

/* paginacao */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 34px; }
.pager .page-info { font-family: var(--font-mono); font-size: 13px; color: var(--txt-3); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 90; background: var(--raised); border: 1px solid var(--line-2); color: var(--txt); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255,101,132,0.5); }

/* mobile tab bar (escondido no desktop) */
.tabbar { display: none; }

/* ===========================================================================
   ANIMACOES
   =========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ===========================================================================
   RESPONSIVO
   =========================================================================== */
@media (max-width: 900px) {
  body[data-page="app"] { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; z-index: 60;
    flex-direction: row; align-items: center; padding: 8px 10px; border-right: none; border-top: 1px solid var(--line-2);
    background: rgba(10,9,17,0.94); backdrop-filter: blur(16px); }
  .sidebar .brand-mark, .sidebar-foot .user-row .user-meta, .nav-count { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { flex-direction: column; gap: 4px; font-size: 10.5px; padding: 7px 12px; }
  .nav-item svg { width: 20px; height: 20px; }
  .main { padding-bottom: 74px; }
  .topbar { padding: 16px 16px 14px; }
  .content { padding: 18px 16px 40px; }
  .page-title { font-size: 22px; }
  .d-hero { grid-template-columns: 130px 1fr; }
  .sidebar-foot .user-row .avatar { margin: 0; }
}
@media (max-width: 560px) {
  .ad-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .meta-grid { grid-template-columns: 1fr; }
  .d-hero { grid-template-columns: 1fr; }
  .d-hero .creative { max-width: 200px; }
  .drawer-body { padding: 16px; }
  .filters .pill { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
