/* enQuadre Portal · Identidad v2 "marco y punto": oscuro, esquinas rectas, lima como único acento. */
/* Tema oscuro (por defecto). La escena de la oficina es una ilustración: siempre oscura. */
:root, .officescene {
  --noche: #101728;
  --superficie: #1D2740;
  --lima: #C6F24E;
  --niebla: #9AA3B8;
  --claro: #F4F5F7;
  --line: #2A3553;
  --head: #18213A;
  --lima-soft: rgba(198, 242, 78, .12);
  --amarillo: #F2C14E;
  --amarillo-soft: rgba(242, 193, 78, .13);
  --rojo: #FF8A80;
  --rojo-soft: rgba(255, 138, 128, .13);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Tokens de uso: texto sobre lima, texto de acento, superficies y gráficos. */
  --on-lima: #101728;
  --accent-text: var(--lima);
  --green-text: var(--lima); /* cifra en verde sin fondo (en claro, un verde oscuro que se lee sobre blanco) */
  /* Tarjeta de la métrica principal: verde lima con letras negras (Noche). */
  --main-card-bg: var(--lima);
  --main-card-fg: var(--on-lima);
  --surface-hover: #222D4A;
  --zebra: rgba(16, 23, 40, .25);
  --eyebrow: #6E7895;
  --chart-main: var(--lima);
  --chart-bar: #4A5577;
  --series-3: #7CC4FF; --series-4: #FF8A80; --series-5: #B8C2D9; --series-6: #9BE3C3; --series-7: #E8B4FF;
  color-scheme: dark;
}

/* Tema claro: fondo Claro, tarjetas blancas, texto Noche. El lima queda para rellenos (con texto oscuro encima):
   como texto sobre fondo claro no se lee, el acento de texto pasa a Noche. Lima y violeta nunca juntos. */
html[data-theme="light"] {
  --noche: #F4F5F7;
  --superficie: #FFFFFF;
  --claro: #101728;
  --niebla: #5A6380;
  --line: #DDE1E8;
  --head: #EEF0F4;
  --lima-soft: rgba(198, 242, 78, .32);
  --amarillo: #9A6A00;
  --amarillo-soft: rgba(242, 193, 78, .22);
  --rojo: #C2362E;
  --rojo-soft: rgba(229, 72, 77, .12);
  --accent-text: #101728;
  --green-text: #3F6B00;
  --surface-hover: #F7F8FA;
  --zebra: rgba(16, 23, 40, .03);
  --eyebrow: #5A6380;
  --chart-main: #101728;
  --chart-bar: #CDD3DE;
  --series-3: #1F7AC9; --series-4: #C2362E; --series-5: #5A6380; --series-6: #1F8A5E; --series-7: #B0306A;
  color-scheme: light;
}
html[data-theme="light"] .officescene { color-scheme: dark; color: var(--claro); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--noche); color: var(--claro); font-family: var(--font); font-weight: 500;
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; letter-spacing: -.03em; }
h1 { font-weight: 800; font-size: 34px; line-height: 1.05; }
h2 { font-weight: 800; font-size: 24px; }
h3 { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.kick, .label {
  font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--niebla);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--niebla); }
.small { font-size: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Botones y campos ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--superficie); color: var(--claro);
  padding: 9px 14px; font-weight: 600; font-size: 13px; border-radius: 0; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--niebla); }
.btn.primary { background: var(--lima); border-color: var(--lima); color: var(--on-lima); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--rojo); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn:focus-visible, .field input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, .nav a:focus-visible {
  outline: 2px solid var(--lima); outline-offset: 2px;
}

.field { display: grid; gap: 6px; }
.field > span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--niebla); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--noche); border: 1px solid var(--line); border-radius: 0; padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--niebla); }
textarea { resize: vertical; min-height: 80px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--lima); width: 16px; height: 16px; }

.error { background: var(--rojo-soft); color: var(--rojo); padding: 10px 12px; font-weight: 600; font-size: 13px; }
.notice { background: var(--amarillo-soft); color: var(--amarillo); padding: 10px 12px; font-weight: 600; font-size: 13px; }

/* ── Marca ──────────────────────────────────────────────────── */
.brandmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brandmark svg { width: 28px; height: 28px; flex: none; }
.brandmark b { font-weight: 800; font-size: 21px; letter-spacing: -.03em; line-height: 1; }
.brandmark b span { color: var(--accent-text); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--line); color: var(--niebla); white-space: nowrap;
}
.tag.demo { border-color: var(--amarillo); color: var(--amarillo); }
.tag.platform { color: var(--claro); border-color: var(--niebla); }
h1 .tag { vertical-align: middle; }
.tag.alta { border-color: transparent; background: var(--rojo-soft); color: var(--rojo); }
.tag.media { border-color: transparent; background: var(--amarillo-soft); color: var(--amarillo); }
.tag.baja { color: var(--niebla); }
.tag.on { border-color: transparent; background: var(--lima-soft); color: var(--accent-text); }

/* ── Login ──────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 20px; }
.login-card form { display: grid; gap: 14px; background: var(--superficie); padding: 24px; }
.login-card h1 { font-size: 28px; }

/* ── Estructura ─────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); padding: 26px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { display: grid; gap: 8px; padding: 0 10px 16px; border-bottom: 1px solid var(--line); }
/* Panel izquierdo plegable: oculto, el contenido usa todo el ancho (y las tablas dejan de necesitar la barra). */
.side-hide {
  position: absolute; top: 22px; right: 10px; width: 28px; height: 28px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--niebla); cursor: pointer; font-size: 15px; line-height: 1;
}
.side-hide:hover { color: var(--claro); border-color: var(--niebla); }
.side-show { display: none; position: fixed; top: 14px; left: 14px; z-index: 15; }
.layout.side-hidden { grid-template-columns: minmax(0, 1fr); }
.layout.side-hidden .side { display: none; }
.layout.side-hidden .side-show { display: inline-flex; }
.layout.side-hidden .wrap { max-width: 1500px; padding-left: 96px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--niebla); text-decoration: none; font-weight: 600;
}
.nav a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }
.nav a:hover { background: var(--superficie); color: var(--claro); }
.nav a[aria-current="page"] { background: var(--superficie); color: var(--claro); box-shadow: inset 2px 0 0 var(--niebla); }
.nav a[aria-current="page"]::before { background: var(--lima); }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--claro); }
.side .me { margin-top: auto; display: grid; gap: 8px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.side .me b { font-weight: 700; }
.side .me .row { display: flex; gap: 6px; flex-wrap: wrap; }

.main { min-width: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; }
.page-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-h .titles { display: grid; gap: 6px; }
.section-h {
  display: flex; align-items: center; gap: 12px; margin: 10px 0 -6px;
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--niebla);
}
.section-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.wrap-flush { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.accounts-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0 -6px; }
.accounts-h .section-h { flex: 1; min-width: 180px; margin: 0; }

.card { background: var(--superficie); padding: 18px 20px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-h em { font-style: normal; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--niebla); }
.empty { color: var(--niebla); text-align: center; padding: 28px 12px; }
.demo-banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border: 1px dashed var(--amarillo); color: var(--amarillo); padding: 10px 14px; font-size: 13px; font-weight: 600;
}

@media (max-width: 860px) {
  .report-head h1 { font-size: 30px; }
  .card-h .chips { margin-left: 0; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; gap: 12px; }
  .side .brand { padding: 0; border: 0; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .nav { grid-auto-flow: column; overflow-x: auto; }
  .side .me { margin: 0; padding: 10px 0 0; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .wrap { padding: 20px 16px 48px; }
  .side-hide, .side-show { display: none !important; }
  .layout.side-hidden .side { display: flex; }
  .layout.side-hidden .wrap { padding-left: 16px; }
  h1 { font-size: 28px; }
}

/* ── La oficina (escena con escritorios) ────────────────────── */
.officescene {
  position: relative; overflow: hidden; padding: 26px 24px 34px;
  background: linear-gradient(180deg, #1A2442 0%, #141C33 46%, #0D1323 100%);
  border: 1px solid var(--line);
}
/* Piso en perspectiva */
.officescene::before {
  content: ""; position: absolute; left: -50%; right: -50%; top: 44%; bottom: -40%;
  background-image: linear-gradient(rgba(154,163,184,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(154,163,184,.13) 1px, transparent 1px);
  background-size: 64px 64px; transform: perspective(420px) rotateX(58deg); transform-origin: top; pointer-events: none;
}
/* Línea del horizonte (donde la pared se junta con el piso) */
.officescene::after { content: ""; position: absolute; left: 0; right: 0; top: 44%; height: 2px; background: rgba(154,163,184,.22); pointer-events: none; }
.scene-title { position: relative; z-index: 1; display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-bottom: 18px; }
.scene-title b { font-weight: 800; font-size: 26px; letter-spacing: -.03em; }
.scene-title b span { color: var(--accent-text); }
.scene-title .kick { letter-spacing: .4em; }
.desks { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 40px; }
.desks .station:nth-child(-n+2) { transform: scale(.9); transform-origin: bottom center; }
.desks .station:nth-child(odd) { justify-self: end; }
.desks .station:nth-child(even) { justify-self: start; }
.desks .station:nth-child(3) { margin-right: 40px; }
.desks .station:nth-child(4) { margin-left: 40px; }

.station { position: relative; width: 300px; max-width: 100%; display: flex; flex-direction: column; align-items: center; }
.say {
  position: relative; z-index: 3; max-width: 270px; min-height: 52px; margin-bottom: 10px; padding: 8px 12px;
  background: var(--claro); color: var(--noche); font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); text-decoration: none; display: grid; gap: 3px; align-content: center;
}
.say::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); }
a.say:hover b { text-decoration: underline; }
.say .k { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #4E5668; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.say .k i { width: 7px; height: 7px; border-radius: 50%; background: var(--noche); flex: none; }
.say .k i.alta { background: #E5484D; } .say .k i.media { background: #D99A00; } .say .k i.ok { background: #6E9A00; }
.say .from { font-family: var(--mono); font-size: 10px; color: #4E5668; font-weight: 500; }
.say.soon { background: rgba(16,23,40,.85); color: var(--niebla); border: 1px dashed var(--line); box-shadow: none; }
.say.soon::after { background: #141C33; border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.say.soon .k { color: var(--niebla); }

.rig { position: relative; width: 100%; }
.robot {
  display: block; width: 138px; height: 138px; margin: 0 auto -34px; position: relative; z-index: 1; object-fit: cover;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 52%, transparent 71%); mask-image: radial-gradient(circle at 50% 46%, #000 52%, transparent 71%);
}
.desk { position: relative; z-index: 2; }
.desk-top { height: 12px; background: #34406A; border-bottom: 1px solid #1A2238; }
.desk-front { background: var(--superficie); padding: 10px 12px 12px; text-align: center; border: 1px solid var(--line); border-top: 0; }
.desk-front b { font-weight: 800; letter-spacing: -.01em; }
.desk-front span { color: var(--niebla); font-size: 12px; margin-left: 6px; }
.desk::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -18px; height: 18px; border-left: 3px solid #26314D; border-right: 3px solid #26314D; }

.monitor { position: absolute; right: 18px; bottom: 100%; width: 84px; height: 56px; background: #0A0F1C; border: 3px solid #2A3553; margin-bottom: 8px; }
.monitor::after { content: ""; position: absolute; left: 50%; bottom: -11px; width: 20px; height: 8px; background: #2A3553; transform: translateX(-50%); }
.monitor svg { width: 100%; height: 100%; display: block; }
.station:not(.off) .monitor { box-shadow: 0 0 22px rgba(198,242,78,.18); }
.lamp { position: absolute; left: 20px; bottom: 100%; width: 3px; height: 40px; background: #3A4566; transform: rotate(-12deg); transform-origin: bottom; }
.lamp::before { content: ""; position: absolute; top: -6px; left: -10px; width: 22px; height: 11px; background: #4E5A80; border-radius: 11px 11px 0 0; }
.station:not(.off) .lamp::after { content: ""; position: absolute; top: 4px; left: -26px; width: 56px; height: 46px; background: radial-gradient(ellipse at top, rgba(244,245,247,.22), transparent 70%); }
.mug { position: absolute; right: 112px; bottom: 100%; width: 12px; height: 12px; background: #E5E7EC; }
.mug::after { content: ""; position: absolute; right: -6px; top: 2px; width: 4px; height: 6px; border: 2px solid #E5E7EC; border-left: 0; }
.station:not(.off) .mug::before { content: "∿"; position: absolute; left: 0; top: -18px; color: rgba(244,245,247,.45); font-size: 13px; animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 0%,100% { transform: translateY(0); opacity: .2; } 50% { transform: translateY(-4px); opacity: .7; } }
.zz { position: absolute; left: calc(50% + 46px); top: 4px; z-index: 2; font-family: var(--mono); font-weight: 700; color: var(--niebla); font-size: 13px; animation: zz 3s ease-in-out infinite; }
.zz span { display: inline-block; font-size: 10px; margin-left: 2px; transform: translateY(-6px); }
@keyframes zz { 0%,100% { opacity: .35; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-5px); } }
.station.off .robot { filter: grayscale(1) brightness(.7); }
.station.off .desk-front b { color: var(--niebla); }
.station.working .monitor svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* Agentes activos: flotan, miran la pantalla, el monitor se "dibuja" y el globo entra con un saltito. Cada uno con su ritmo. */
.station:not(.off) .robot { animation: bob 3.2s ease-in-out infinite, look 9s ease-in-out infinite; transform-origin: 50% 85%; }
.station:not(.off) .say { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.station:not(.off) .monitor svg { animation: screen 4s ease-in-out infinite; }
.station:not(.off) .monitor::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(198,242,78,.55); animation: scan 2.6s linear infinite; z-index: 1; }
.station:not(.off) .desk-front b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; vertical-align: 1px; background: var(--lima); animation: live 1.6s ease-in-out infinite; }
.station:not(.off):hover .robot { animation: hop .6s ease-out; }
.desks .station:nth-child(2) .robot, .desks .station:nth-child(2) .monitor::before { animation-delay: -1.1s; }
.desks .station:nth-child(2) .say { animation-delay: .15s; }
.desks .station:nth-child(3) .robot, .desks .station:nth-child(3) .monitor::before { animation-delay: -2.1s; }
.desks .station:nth-child(4) .robot, .desks .station:nth-child(4) .monitor::before { animation-delay: -.6s; }
.station.working .robot { animation: bob 1.1s ease-in-out infinite !important; }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes look { 0%,40%,100% { rotate: 0deg; } 46%,56% { rotate: -5deg; } 62%,72% { rotate: 4deg; } 78% { rotate: 0deg; } }
@keyframes hop { 0% { translate: 0 0; } 35% { translate: 0 -16px; } 65% { translate: 0 0; } 80% { translate: 0 -4px; } 100% { translate: 0 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes screen { 0%,100% { opacity: 1; } 50% { opacity: .7; } }
@keyframes scan { from { top: 0; opacity: .9; } to { top: calc(100% - 2px); opacity: .2; } }
@keyframes live { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(198,242,78,.6); } 50% { opacity: .55; box-shadow: 0 0 0 4px rgba(198,242,78,0); } }
@media (prefers-reduced-motion: reduce) {
  .zz, .mug::before, .station .robot, .station .say, .station .monitor svg, .station .monitor::before, .station .desk-front b::before { animation: none !important; }
}

@media (max-width: 760px) {
  .officescene { padding: 20px 12px 28px; }
  .desks { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .desks .station, .desks .station:nth-child(n) { transform: none; justify-self: center; margin: 0; }
}

/* ── Mis cuentas ────────────────────────────────────────────── */
.plat-block { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.plat-h { display: flex; align-items: baseline; gap: 10px; margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.plat-h .muted { font-size: 13px; font-weight: 400; }
.plat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--niebla); align-self: center; }
.plat-dot.meta { background: #0866FF; }
.plat-dot.google { background: #FBBC04; }
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.acc { background: var(--superficie); padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.acc-h { display: flex; align-items: flex-start; gap: 10px; }
.acc-h a { text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; flex: 1; }
.acc-h a:hover { text-decoration: underline; }
.light { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 5px; }
.light.verde { background: var(--lima); }
.light.amarillo { background: var(--amarillo); }
.light.rojo { background: var(--rojo); }
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acc-stats div { display: grid; gap: 2px; }
.acc-stats b { font-family: var(--mono); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.acc .finding { font-size: 12.5px; color: var(--claro); border-left: 2px solid var(--line); padding-left: 10px; }
.acc .review { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }

/* ── Reporte ────────────────────────────────────────────────── */
.report { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.pdf-fit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; padding-top: 6px; }
.report-head .titles { display: grid; gap: 14px; }
.report-head .eyebrow { font-weight: 700; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; color: var(--eyebrow); }
.report-head h1 { font-size: 40px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-head .meta { font-family: var(--mono); font-size: 12px; color: var(--niebla); padding-bottom: 6px; }
.toolbar { justify-content: space-between; }
.live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--niebla); margin-right: 4px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--claro); opacity: .7; }
.live.on::before { animation: pulse 1s ease-in-out infinite; }
.findings-box { background: var(--superficie); padding: 10px 14px; }
.findings-box summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--amarillo); }
.findings-box .findings { margin-top: 10px; }
.fb { flex: none; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--superficie); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--niebla); padding: 6px 12px; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.seg button:hover { color: var(--claro); }
.seg button[aria-pressed="true"] { background: var(--lima); color: var(--on-lima); font-weight: 700; }

.secwrap { position: relative; }
.hide-btn {
  position: absolute; top: -9px; right: -9px; z-index: 2; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 2px 8px; border: 1px solid var(--line); background: var(--superficie); color: var(--niebla); cursor: pointer; opacity: .6;
}
.secwrap:hover > .hide-btn, .hide-btn:focus-visible { opacity: 1; }
.hide-btn.inline { position: static; margin-left: auto; }
@media (hover: none) { .hide-btn { opacity: 1; } }
.hidden-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px dashed var(--line); padding: 10px 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--head); padding: 4px 6px 4px 12px; font-size: 12px; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.kpi { background: var(--superficie); padding: 16px 18px 18px; display: flex; flex-direction: column; min-width: 0; }
.kpi .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--niebla); line-height: 1.4; }
.kpi .v { font-size: clamp(22px, 2.3vw, 30px); font-weight: 800; letter-spacing: -.03em; margin-top: 12px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--niebla); margin-top: 6px; }
.kpi .s .bad { color: var(--rojo); }
.kpi .s .good { color: var(--claro); }
/* Métrica principal: tarjeta verde lima con letras negras (igual en los dos temas). */
.kpi.main, .ov-kpi.main { background: var(--main-card-bg); }
.kpi.main .l, .kpi.main .v, .kpi.main .s, .ov-kpi.main .l, .ov-kpi.main .v, .ov-kpi.main .s, .ov-kpi.main .s .vs { color: var(--main-card-fg); }
.kpi.main .l::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--main-card-fg); margin-right: 8px; vertical-align: 1px; }
/* Seguidores nuevos: destacada con la cifra en verde, sin fondo. */
.kpi.feature .v, .ov-kpi.feature .v { color: var(--green-text); }
.kpi.feature .l::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green-text); margin-right: 8px; vertical-align: 1px; }
.bar { position: relative; height: 9px; background: var(--head); margin-top: 12px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--lima); }
.bar i.over { background: var(--rojo); }
.bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--niebla); }
.bar-l { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--niebla); margin-top: 8px; line-height: 1.3; }
.bar-l strong { color: var(--claro); }
.kpi { position: relative; }
/* Animación de las tarjetas al pasar el mouse: se levantan, aparece un marco y la cifra crece un poco. */
.kpi { transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, background-color .22s ease; outline: 1px solid transparent; outline-offset: -1px; }
.kpi .v { transition: transform .22s cubic-bezier(.2,.8,.2,1); transform-origin: left center; }
.kpi::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--niebla); transition: width .35s cubic-bezier(.2,.8,.2,1); }
.kpi.main::after { background: var(--main-card-fg); }
.kpi .bar i { transition: filter .22s ease; }
@media (hover: hover) {
  .kpi:hover { transform: translateY(-4px); background-color: var(--surface-hover); box-shadow: 0 10px 24px rgba(0,0,0,.35); outline-color: var(--line); }
  .kpi:hover .v { transform: scale(1.04); }
  .kpi.main:hover { background-color: var(--main-card-bg); }
  .kpi:hover::after { width: 100%; }
  .kpi:hover .bar i { filter: brightness(1.12); }
}
.edit-btn { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 2px 8px; border: 1px solid var(--line); background: var(--noche); color: var(--niebla); cursor: pointer; }
.edit-btn:hover, .edit-btn:focus-visible { color: var(--claro); border-color: var(--niebla); }

.chart { width: 100%; height: auto; display: block; }
/* Gráfico interactivo */
.chart-box { position: relative; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar-d { transition: fill-opacity .15s ease; }
.chart .dot { transition: transform .15s ease; transform-box: fill-box; transform-origin: center; }
.chart .guide { opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.chart.hovering .bar-d { fill-opacity: .3; }
.chart.hovering .bar-d.on { fill-opacity: .95; }
.chart .dot.on { transform: scale(1.6); }
.chart .guide.on { opacity: 1; }
.chart .line { stroke-dasharray: var(--len, 4000); stroke-dashoffset: 0; animation: draw 1.1s cubic-bezier(.4,0,.2,1); }
@keyframes draw { from { stroke-dashoffset: var(--len, 4000); } }
.chart-tip { position: absolute; z-index: 4; pointer-events: none; background: var(--claro); color: var(--noche); padding: 8px 10px; min-width: 150px; box-shadow: 0 8px 20px rgba(0,0,0,.35); transform: translate(-50%, calc(-100% - 12px)); font-size: 12px; display: grid; gap: 3px; }
.chart-tip .d { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #4E5668; }
.chart-tip div { display: flex; justify-content: space-between; gap: 14px; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; }
@media (prefers-reduced-motion: reduce) { .kpi, .kpi .v, .kpi::after, .chart .dot, .chart .line { transition: none !important; animation: none !important; } }
.legend { display: flex; gap: 18px; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--niebla); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--claro) 0 4px, transparent 4px 7px); height: 2px; }
.legend i.dash.amarillo { background: repeating-linear-gradient(90deg, var(--amarillo) 0 4px, transparent 4px 7px); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th {
  background: var(--head); color: var(--niebla); font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; text-align: left; padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.n, td.n { text-align: right; white-space: nowrap; }
/* Tablas ordenables */
table.sortable thead th { cursor: pointer; user-select: none; transition: color .15s ease; }
table.sortable thead th:hover, table.sortable thead th:focus-visible { color: var(--claro); }
table.sortable thead th.nosort { cursor: default; }
table.sortable thead th .arr { display: inline-block; width: 10px; margin-left: 4px; opacity: .35; }
table.sortable thead th[aria-sort] { color: var(--claro); }
table.sortable thead th[aria-sort] .arr { opacity: 1; }
td.name { font-weight: 600; min-width: 200px; max-width: 320px; }
tfoot td { font-weight: 700; background: var(--head); }

/* Tablas del reporte (modelo Reporte clientes) */
.rtable td { font-size: 13.5px; padding: 14px 12px; }
.rtable td.name { font-weight: 700; }
.rtable tbody tr:nth-child(even) td { background: var(--zebra); }
.pills { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.pill { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; background: var(--head); color: var(--niebla); }
.pill.on { background: var(--lima-soft); color: var(--accent-text); }
.pill.alta { background: var(--rojo-soft); color: var(--rojo); }
.card-h .chips { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--noche); padding: 5px 10px; font-family: var(--mono); font-size: 11.5px; color: var(--niebla); }
.chips b { color: var(--claro); font-weight: 700; margin-left: 4px; }
.adgroup .card-h .hide-btn.inline { margin-left: 4px; }
.ads-table td.name { min-width: 170px; max-width: 220px; }
.ads-table td.creative { min-width: 330px; max-width: 420px; }
.cr { display: flex; gap: 12px; align-items: flex-start; }
.thumb { width: 66px; height: 86px; object-fit: cover; border: 2px solid var(--niebla); flex: none; background: var(--head); }
.thumb.none { display: grid; place-items: center; text-align: center; font-family: var(--mono); font-size: 10px; color: var(--niebla); background: var(--noche); }
.cr-body { min-width: 0; display: grid; gap: 3px; }
.cr-body b { font-weight: 700; font-size: 13px; }
.cr-body p { margin: 0; color: var(--niebla); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cr-body a { color: var(--accent-text); font-weight: 700; font-size: 12px; text-decoration: none; }
.cr-body a:hover { text-decoration: underline; }

/* Pestañas del reporte */
.rtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.rtabs a { padding: 10px 16px; color: var(--niebla); font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.rtabs a:hover { color: var(--claro); }
.rtabs a[aria-current="page"] { color: var(--claro); border-bottom-color: var(--lima); }
.pdf-preview .rtabs, .exporting .rtabs { display: none; }

/* Reporte semanal */
.weekly { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.wkpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wkpi .s { line-height: 1.5; }
.delta { font-family: var(--mono); font-weight: 700; font-size: 11.5px; padding: 1px 6px; }
.delta.up { color: var(--accent-text); background: var(--lima-soft); }
.delta.down { color: var(--rojo); background: var(--rojo-soft); }
.delta.flat { color: var(--niebla); background: var(--head); }
.goal-set { margin-top: 14px; align-self: flex-start; background: transparent; border: 1px dashed var(--niebla); color: var(--niebla); padding: 6px 10px; font-weight: 700; font-size: 12px; cursor: pointer; }
.goal-set:hover { color: var(--claro); border-color: var(--claro); }
.goal { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.goal-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--niebla); }
.goal-h i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--niebla); }
.goal-h b { color: var(--claro); }
.goal .bar { margin-top: 2px; }
.goal .bar i { background: var(--niebla); }
.goal.verde .goal-h i, .goal.verde .bar i { background: var(--lima); }
.goal.amarillo .goal-h i, .goal.amarillo .bar i { background: var(--amarillo); }
.goal.rojo .goal-h i, .goal.rojo .bar i { background: var(--rojo); }
.goal-t { font-size: 12px; font-weight: 700; }
.goal.verde .goal-t { color: var(--accent-text); } .goal.amarillo .goal-t { color: var(--amarillo); } .goal.rojo .goal-t { color: var(--rojo); }
.edit-btn.static { position: static; }
.wgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.topads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.topad { background: var(--noche); display: grid; grid-template-rows: auto 1fr; transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease; }
@media (hover: hover) { .topad:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.35); } }
.shot { position: relative; aspect-ratio: 1 / 1; border: 2px solid var(--niebla); background: var(--head); overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .none { display: grid; place-items: center; height: 100%; font-family: var(--mono); color: var(--niebla); }
.shot .rank { position: absolute; top: 0; left: 0; background: var(--noche); color: var(--claro); font-family: var(--mono); font-weight: 700; font-size: 12px; padding: 4px 9px; }
.topad:first-child .shot .rank { background: var(--lima); color: var(--on-lima); }
.topad-b { padding: 12px; display: grid; gap: 6px; align-content: start; }
.topad-b > b { font-size: 14px; }
.topad-m { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.topad-m div { display: grid; gap: 2px; }
.topad-m strong { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.topad-b a { color: var(--accent-text); font-weight: 700; font-size: 12px; text-decoration: none; }
.topad-b a:hover { text-decoration: underline; }
.topad-links { display: grid; gap: 4px; margin-top: 4px; }
.freq-pick { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; font-size: 13px; }
.freq-pick .check i { display: inline-block; width: 14px; height: 3px; }
.freq-pick .check i.dash { background: repeating-linear-gradient(90deg, var(--niebla) 0 4px, transparent 4px 7px); height: 2px; }
.freq-alert { background: var(--rojo-soft); color: var(--rojo); padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.freq-alert b { color: var(--claro); }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: var(--superficie); padding: 12px 16px; border-left: 3px solid var(--lima); }
.period-bar select { width: auto; min-width: 260px; font-weight: 700; }
.period-bar .btn:disabled { opacity: .35; cursor: default; }
.note-info { margin: 0; padding: 10px 14px; border-left: 3px solid var(--niebla); background: var(--superficie); color: var(--niebla); font-size: 12.5px; line-height: 1.5; }
.note-info b { color: var(--claro); }
.chips .chips-k { background: transparent; padding-left: 0; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }

/* Vista previa estilo Biblioteca de anuncios */
.cr-links { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--claro); font-weight: 700; font-size: 12px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--niebla); text-underline-offset: 3px; }
.linkbtn:hover { text-decoration-color: var(--claro); }
.lib-link { font-family: var(--font); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--claro); font-weight: 700; text-decoration: none; }
.lib-link:hover { text-decoration: underline; }
.lib-dlg { width: min(460px, calc(100vw - 32px)); }
.lib-dlg-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lib-card { background: #FFFFFF; color: #1C1E21; border: 1px solid #DADDE1; font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; font-weight: 400; }
.lib-top { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 12px; color: #65676B; border-bottom: 1px solid #DADDE1; }
.lib-status { font-weight: 600; color: #65676B; }
.lib-status.on { color: #1D7A3A; }
.lib-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.lib-head { display: flex; gap: 10px; align-items: center; padding: 12px 12px 6px; }
.lib-head img, .lib-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.lib-avatar { display: grid; place-items: center; background: #E4E6EB; font-weight: 700; }
.lib-head b { display: block; font-size: 14px; font-weight: 600; }
.lib-head span { font-size: 12px; color: #65676B; }
.lib-body { margin: 0; padding: 4px 12px 10px; font-size: 14px; line-height: 1.4; white-space: pre-line; }
.lib-media img { width: 100%; display: block; }
.lib-none { display: grid; place-items: center; height: 220px; background: #F0F2F5; color: #65676B; }
.lib-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: #F0F2F5; }
.lib-foot b { display: block; font-size: 14px; font-weight: 600; }
.lib-domain { font-size: 11px; color: #65676B; }
.lib-cta { background: #E4E6EB; color: #1C1E21; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }

/* Tipo de cliente */
.objs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.objs .kick { margin-right: 2px; }
.obj { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); background: var(--superficie); color: var(--niebla); font-size: 13px; cursor: pointer; }
.obj input { margin: 0; accent-color: var(--lima); }
.obj.on { color: var(--claro); border-color: var(--niebla); }
.obj em { font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.obj:has(input:disabled) { cursor: not-allowed; opacity: .8; }
.need-type { display: grid; gap: 12px; justify-items: start; border-left: 3px solid var(--amarillo); }
.need-type h3 { font-size: 18px; }
.excluded-note { margin: -8px 0 0; color: var(--niebla); font-size: 12px; font-style: italic; }

/* Reporte semanal · 3 Q's */
.qblock { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 22px 0 0; font-size: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.qblock .qn { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--lima); color: var(--on-lima); font-size: 18px; flex: none; align-self: center; }
.qblock em { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--niebla); font-weight: 500; }
.sem { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 8px; white-space: nowrap; }
.sem i { font-style: normal; font-size: 10px; }
.sem.verde { color: var(--accent-text); background: var(--lima-soft); }
.sem.amarillo { color: var(--amarillo); background: var(--amarillo-soft); }
.sem.rojo { color: var(--rojo); background: var(--rojo-soft); }
.kpi .l .tip { font-style: normal; display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--niebla); border-radius: 50%; font-size: 9px; margin-left: 4px; }
.goal .sem { white-space: normal; }
.dtable td { vertical-align: top; }
.funnel { display: grid; gap: 10px; }
.fstep { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 2fr) minmax(170px, 1fr); gap: 6px 14px; align-items: center; padding: 10px 12px; background: var(--noche); border-left: 3px solid transparent; }
.fstep.weak { border-left-color: var(--rojo); background: rgba(255, 138, 128, .06); }
.fstep-h { display: grid; gap: 2px; }
.fbar { position: relative; height: 22px; background: var(--head); }
.fbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--niebla); opacity: .45; }
.fbar span { position: relative; font-family: var(--mono); font-size: 11px; padding-left: 8px; line-height: 22px; }
.fstep-v { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fstep-v strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.weak-note { grid-column: 1 / -1; color: var(--rojo); font-weight: 700; font-size: 12.5px; }
@media (max-width: 760px) { .fstep { grid-template-columns: 1fr; } }
.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.changes li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; border-left: 2px solid var(--line); padding-left: 10px; }
.followup { background: var(--superficie); border-left: 3px solid var(--lima); padding: 12px 16px; display: grid; gap: 4px; }
.followup p { margin: 0; }
.rule { margin: -6px 0 0; padding: 8px 12px; background: var(--amarillo-soft); color: var(--amarillo); font-weight: 700; font-size: 13px; }
.ctags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ctag { font-size: 12px; font-weight: 600; padding: 4px 8px; background: var(--noche); border: 1px solid var(--line); }
.ctag.learn { border-color: var(--amarillo); color: var(--amarillo); }
.warn { font-size: 12px; font-weight: 700; padding: 6px 8px; background: var(--head); border-left: 3px solid var(--niebla); }
.warn.wait, .warn.only, .warn.desglose { border-left-color: var(--amarillo); color: var(--amarillo); }
.warn.low_share { border-left-color: var(--niebla); color: var(--claro); }
.warn.candidate { border-left-color: var(--rojo); color: var(--rojo); }
.topad-m .sem { margin-top: 2px; justify-self: start; }
.allads { margin-top: 12px; }
.allads summary { cursor: pointer; font-weight: 700; color: var(--claro); }
.allads .tbl-wrap { margin-top: 10px; }
.decide form { display: grid; gap: 14px; }
.actions-list { display: grid; gap: 8px; }
.action { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--noche); border-left: 3px solid var(--line); cursor: pointer; }
.action.rojo { border-left-color: var(--rojo); } .action.amarillo { border-left-color: var(--amarillo); } .action.verde { border-left-color: var(--lima); }
.action > span { display: grid; gap: 4px; justify-items: start; }
.action input[type=radio] { accent-color: var(--lima); margin-top: 3px; }
.action.own input[type=text] { margin-top: 4px; }
.decisions { display: grid; gap: 8px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.dec { display: grid; gap: 2px; }

/* Vista compartida */
.share-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--line); max-width: 1168px; margin: 0 auto; }
.share-dlg { width: min(620px, calc(100vw - 32px)); }
.dlg-body { display: grid; gap: 14px; }
.share-list { display: grid; gap: 12px; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; }
.share-row input { font-family: var(--mono); font-size: 12px; }
.share-row .small { grid-column: 1 / -1; }

.findings { display: grid; gap: 8px; }
.finding-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; background: var(--superficie); padding: 12px 16px; align-items: start; }
.finding-row .tag { margin-top: 2px; }
.finding-row b { font-weight: 700; }
.finding-row p { margin: 0; color: var(--niebla); font-size: 13px; grid-column: 2; }
.finding-row .who { grid-column: 2; font-family: var(--mono); font-size: 11px; color: var(--niebla); }
.finding-row .who a { color: var(--claro); }

.foot { color: var(--niebla); font-size: 12px; border-top: 1px solid var(--line); padding-top: 14px; }

/* Exportación a PDF: ancho fijo para que todas las páginas salgan iguales. */
.exporting .report, .pdf-preview .report { width: 1100px; }
.exporting .tbl-wrap, .pdf-preview .tbl-wrap { overflow: hidden; }
.exporting th, .exporting td, .pdf-preview th, .pdf-preview td { padding: 9px 8px; font-size: 12px; }
.exporting th, .pdf-preview th { white-space: normal; vertical-align: bottom; }
.exporting td.name, .pdf-preview td.name { min-width: 0; }
.exporting .ads-table td.creative, .pdf-preview .ads-table td.creative { min-width: 300px; }
.exporting .live, .exporting .findings-box { display: none !important; }
.exporting .kpi, .exporting .kpi .v { transition: none !important; transform: none !important; }

/* Vista PDF: el reporte con el ancho exacto de la hoja, un marco punteado y una línea punteada en cada corte de página. */
.pdf-preview .wrap { max-width: none; overflow-x: auto; }
.pdf-preview .report { position: relative; outline: 2px dashed rgba(154,163,184,.55); outline-offset: 10px; margin: 14px 10px 30px; }
.pdf-preview .findings-box, .pdf-preview .no-pdf.kpi { opacity: .35; }
.pdf-break { position: absolute; left: -24px; right: -24px; height: 0; border-top: 2px dashed var(--amarillo); z-index: 5; pointer-events: none; }
.pdf-break span { position: absolute; left: 24px; top: -11px; background: var(--amarillo); color: var(--on-lima); font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; }
.tbl-wrap.fitted { border-color: rgba(242,193,78,.5); }
.pdf-info { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; border: 1px dashed var(--amarillo); color: var(--amarillo); padding: 10px 14px; font-size: 13px; font-weight: 600; }
.exporting .hide-btn, .exporting .no-pdf { display: none !important; }
.overlay { position: fixed; inset: 0; background: rgba(16, 23, 40, .85); display: grid; place-items: center; z-index: 20; font-weight: 700; }

/* ── Admin ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: transparent; border: 0; padding: 10px 14px; color: var(--niebla); font-weight: 600; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--claro); border-bottom-color: var(--lima); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
td input[type=text], td input[type=number], td select { padding: 6px 8px; min-width: 90px; }
td.num-in input { width: 120px; }
.assign { display: grid; gap: 12px; }
.assign-group { display: grid; gap: 8px; }
.agent-card { display: grid; gap: 14px; }
.agent-card .card-h { margin-bottom: 0; }
.agent-about { margin: 0; max-width: 78ch; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 0; display: grid; gap: 10px; min-width: 0; }
.rule p { margin: 0; max-width: 78ch; }
.rule .field em { font-style: normal; }
.rule input:disabled, .rule select:disabled { opacity: .45; }
.assign .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }

dialog { background: var(--superficie); color: var(--claro); border: 1px solid var(--line); padding: 22px; width: min(440px, calc(100vw - 32px)); border-radius: 0; }
dialog::backdrop { background: rgba(16, 23, 40, .7); }
dialog form { display: grid; gap: 14px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--claro); color: var(--noche);
  padding: 10px 16px; font-size: 13px; font-weight: 700; max-width: calc(100% - 32px); z-index: 30;
}

/* Google Ads: nivel de calidad, términos y anuncios de texto */
.qs { display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 14px; }
.qs-avg { display: grid; gap: 6px; justify-items: start; }
.qs-avg strong { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.qs-parts { display: grid; gap: 12px; }
.qs-part { display: grid; gap: 5px; }
.qs-part.weak b { color: var(--amarillo); }
.qs-bar { display: flex; height: 8px; background: rgba(154,163,184,.18); }
.qs-bar .below { background: var(--rojo); }
.qs-bar .above { background: var(--lima); margin-left: auto; }
.txtad { position: absolute; inset: 0; display: grid; align-content: center; gap: 6px; padding: 16px; background: #F4F5F7; color: #101728; text-align: left; }
.txtad-s { font-size: 11px; font-weight: 700; color: #3A4566; }
.txtad b { color: #1A0DAB; font-size: 15px; line-height: 1.25; font-weight: 600; }
.txtad p { margin: 0; font-size: 12.5px; line-height: 1.4; color: #3A4566; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
@media (max-width: 640px) { .qs { grid-template-columns: minmax(0, 1fr); } }
.obj-list { display: flex; flex-direction: column; gap: 4px; white-space: nowrap; }
.obj-list .check { font-size: 13px; }
.tag.other { color: var(--niebla); border-color: var(--line); }
.theme-seg { display: flex; margin-top: 10px; }
.theme-seg button { flex: 1; padding: 5px 6px; }

/* ── Reporte de cliente: pestañas Resumen / Detalle y gráficos del Resumen ── */
.rep-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.rep-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 16px; font: inherit; font-weight: 700; color: var(--niebla); cursor: pointer; }
.rep-tabs button[aria-selected="true"] { color: var(--claro); border-bottom-color: var(--lima); }
.rep-tabs button:hover { color: var(--claro); }
.ov { display: grid; gap: 12px; }
.ov-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ov-kpi { position: relative; background: var(--superficie); border-radius: 14px; padding: 16px 18px 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.ov-kpi .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--niebla); }
.ov-kpi .v { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* En la tarjeta principal, la variación va en una etiqueta oscura para que se lean el verde y el rojo. */
.ov-kpi.main .delta { background: #101728; padding: 1px 6px; color: #9AA3B8; }
.ov-kpi.main .delta.good { color: #9BE3C3; }
.ov-kpi.main .delta.bad { color: #FF8A80; }
.ov-kpi .s { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; min-height: 18px; margin-top: 6px; font-size: 12px; color: var(--niebla); }
.ov-kpi .s .vs { font-size: 11px; }
.ov-spark { display: block; width: calc(100% + 36px); height: 48px; margin: 10px -18px 0; }
.delta { font-weight: 700; font-size: 12px; color: var(--niebla); white-space: nowrap; }
.delta.good { color: var(--series-6); }
.delta.bad { color: var(--rojo); }
.ov-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px; }
.ov-row.solo { grid-template-columns: minmax(0, 1fr); }
.ov-row.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ov-card { border-radius: 14px; }
.ov-budget { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ov-budget .card-h { align-self: stretch; }
.ov-ring { width: 180px; max-width: 100%; height: auto; }
.ov-budget-l { font-size: 13px; margin-top: 6px; }
.ov-donut { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; }
.ov-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.ov-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
.ov-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ov-legend .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-legend .m { grid-column: 2 / 4; font-size: 11.5px; color: var(--niebla); }
.ov-bars { display: grid; gap: 12px; }
.ov-bar .t { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.ov-bar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ov-bar .m { white-space: nowrap; color: var(--niebla); font-size: 12px; }
.ov-bar .m b { color: var(--claro); }
.track { height: 9px; background: var(--line); border-radius: 99px; overflow: hidden; flex: 1; }
.track i { display: block; height: 100%; background: var(--chart-main); border-radius: 99px; }
.ov-note { margin: 14px 0 0; }
.ov-funnel { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; }
.ov-step { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--noche); border: 1px solid; border-left-width: 6px; font-weight: 700; font-size: 13px; min-width: 190px; }
.ov-step span { display: inline-flex; align-items: center; gap: 8px; }
.ov-step span i { width: 8px; height: 8px; border-radius: 50%; }
.ov-step b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ov-rate { font-family: var(--mono); font-size: 11px; color: var(--niebla); padding: 2px 0; }
.ov-rate b { color: var(--claro); }
.ov-cmp { display: grid; gap: 16px; }
.ov-cmp-row .t { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ov-cmp-row .pair { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(90px, auto); gap: 10px; align-items: center; font-size: 12px; margin-top: 4px; }
.ov-cmp-row .pair .k { color: var(--niebla); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.ov-cmp-row .pair b { text-align: right; font-variant-numeric: tabular-nums; }
.ov-cmp-row .pair.prev i { background: var(--chart-bar); }
@media (max-width: 860px) {
  .ov-row, .ov-row.half { grid-template-columns: minmax(0, 1fr); }
  .ov-donut { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .ov-legend { width: 100%; }
  .ov-bar .t { flex-wrap: wrap; }
  .ov-bar .m { white-space: normal; }
}
