/* Eskalamos Tracker · panel de resultados (escritorio y portal del cliente) */
.etk-app, .etk-login {
	--ink: #0f2742;
	--ink-2: #2b4462;
	--muted: #5e6e80;
	--rule: #dce2ea;
	--canvas: #f3f5f8;
	--panel: #ffffff;
	--signal: #e8641b;      /* resultados de negocio: contactos, valor */
	--signal-soft: #fdeee4;
	--data: #2563c9;        /* series de apoyo: sesiones, clics */
	--data-soft: #e6eefb;
	--up: #1b8a5a;
	--down: #c23b2a;
	--warn: #a86a00;
	--g1: #1b8a5a; --g2: #7fb23a; --g3: #e3a21a; --g4: #e8641b; --g5: #c23b2a; --g6: #6b1d14; --g0: #b7c0cb;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.etk-app *, .etk-app *::before, .etk-app *::after { box-sizing: border-box; }
.etk-body { margin: 0; background: var(--canvas); }
.etk-in-admin { margin: 14px 0 0 -2px; }
.etk-in-admin .etk-top { border-radius: 6px 6px 0 0; }

/* barra superior */
.etk-top { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 14px 24px; background: var(--ink); color: #fff; }
.etk-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .01em; }
.etk-brand img { max-height: 28px; width: auto; }
.etk-top select, .etk-top input[type=date] { font: inherit; color: var(--ink); background: #fff; border: 1px solid transparent; border-radius: 6px; padding: 6px 10px; min-height: 36px; }
.etk-top .etk-spacer { flex: 1 1 auto; }
.etk-top a, .etk-top button.etk-link { color: #cfd9e6; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 2px; }
.etk-top a:hover, .etk-top button.etk-link:hover { color: #fff; text-decoration: underline; }
.etk-periods { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.etk-periods button { font: inherit; font-size: 14px; color: #cfd9e6; background: transparent; border: 1px solid #3a5577; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.etk-periods button[aria-pressed=true] { background: #fff; color: var(--ink); border-color: #fff; }
.etk-custom { display: none; gap: 6px; align-items: center; }
.etk-custom.on { display: flex; }

/* pestañas */
.etk-tabs { display: flex; gap: 2px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.etk-tabs button { font: inherit; font-weight: 550; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 14px 11px; cursor: pointer; white-space: nowrap; }
.etk-tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); }
.etk-tabs button:hover { color: var(--ink); }

.etk-main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.etk-in-admin .etk-main { background: var(--canvas); max-width: none; }

/* frase resumen */
.etk-lede { font-size: clamp(21px, 2.4vw, 28px); line-height: 1.3; font-weight: 500; max-width: 46ch; margin: 0 0 6px; letter-spacing: -.01em; }
.etk-lede strong { font-weight: 700; }
.etk-lede .etk-goal { color: var(--signal); }
.etk-sub { color: var(--muted); margin: 0 0 24px; max-width: 75ch; }

/* cifras */
.etk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin: 0 0 22px; }
.etk-kpi { padding: 16px 18px; background: var(--panel); }
.etk-kpi .k-label { color: var(--muted); font-size: 14px; display: block; margin-bottom: 2px; }
.etk-kpi .k-val { font-size: 28px; font-weight: 650; line-height: 1.15; letter-spacing: -.015em; }
.etk-kpi.is-goal .k-val { color: var(--signal); }
.etk-kpi .k-foot { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.etk-delta { font-weight: 600; font-size: 13px; white-space: nowrap; }
.etk-delta.up { color: var(--up); }
.etk-delta.down { color: var(--down); }
.etk-delta.flat { color: var(--muted); }

/* paneles */
.etk-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 18px 20px; margin: 0 0 22px; }
.etk-panel > h2, .etk-panel > header h2 { font-size: 17px; font-weight: 650; margin: 0 0 4px; }
.etk-panel > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; margin-bottom: 10px; }
.etk-panel > p.etk-note, .etk-note { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; max-width: 80ch; }
.etk-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 22px; }
.etk-grid2 > * { min-width: 0; }
.etk-grid2 > .etk-panel { margin: 0; }
.etk-grid2 + .etk-panel, .etk-grid2 + .etk-grid2 { margin-top: 22px; }
.etk-chart { position: relative; height: 290px; }
.etk-chart.sm { height: 220px; }
.etk-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.etk-legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }

/* tablas */
.etk-table-wrap { overflow-x: auto; }
.etk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.etk-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.etk-table th.sortable { cursor: pointer; user-select: none; }
.etk-table th.sortable:hover { color: var(--ink); }
.etk-table th[aria-sort=ascending]::after { content: " ↑"; }
.etk-table th[aria-sort=descending]::after { content: " ↓"; }
.etk-table td { padding: 8px 10px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
.etk-table tr:last-child td { border-bottom: 0; }
.etk-table .num { text-align: right; white-space: nowrap; }
.etk-table .grp-row td { background: #f7f9fb; font-weight: 600; }
.etk-table a { color: var(--data); text-decoration: none; }
.etk-table a:hover { text-decoration: underline; }
.etk-table .kw { min-width: 200px; }
.etk-table .url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; color: var(--muted); font-size: 12.5px; }
.etk-pos { display: inline-block; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.etk-pos.top3 { background: #dff3ea; color: #12603f; }
.etk-pos.top10 { background: #eaf4dc; color: #3e6212; }
.etk-pos.top30 { background: #fbf1d9; color: #7a5300; }
.etk-pos.top100 { background: #f1f3f6; color: var(--ink-2); }
.etk-pos.out { background: transparent; color: #98a3b0; font-weight: 400; }
.etk-pos.in10 { box-shadow: inset 0 0 0 2px var(--data); }
.etk-pos.out10 { box-shadow: inset 0 0 0 2px var(--down); }
.etk-tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #eef1f5; color: var(--ink-2); white-space: nowrap; }
.etk-tag.aio { background: var(--data-soft); color: #1b4c9e; }
.etk-tag.aio-c { background: #1b4c9e; color: #fff; }
.etk-tag.goal { background: var(--signal-soft); color: #9a3f0b; }
.etk-tag.bad { background: #fbe7e4; color: var(--down); }

/* filtros */
.etk-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.etk-filters input[type=search], .etk-filters select { font: inherit; font-size: 14px; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 10px; min-height: 34px; background: #fff; color: var(--ink); }
.etk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.etk-chips button { font: inherit; font-size: 13px; border: 1px solid var(--rule); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.etk-chips button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.etk-chips button b { font-weight: 650; margin-left: 4px; }

/* SEO local */
.etk-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 22px; }
.etk-track { text-align: left; font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; cursor: pointer; }
.etk-track[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.etk-track .t-kw { font-weight: 650; display: block; margin-bottom: 6px; }
.etk-track .t-row { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.etk-track .t-row b { color: var(--ink); font-size: 15px; }
.etk-map { height: 470px; border-radius: 6px; border: 1px solid var(--rule); z-index: 0; }
.etk-pin { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 1px 3px rgba(15,39,66,.35); }
.etk-pin.p1 { background: var(--g1); } .etk-pin.p2 { background: var(--g2); } .etk-pin.p3 { background: var(--g3); } .etk-pin.p4 { background: var(--g4); } .etk-pin.p5 { background: var(--g5); } .etk-pin.p6 { background: var(--g6); } .etk-pin.p0 { background: var(--g0); }
.etk-scale { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.etk-scale span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.etk-local-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 22px; }
.etk-stat-list { margin: 0; padding: 0; list-style: none; }
.etk-stat-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f5; }
.etk-stat-list li:last-child { border-bottom: 0; }
.etk-stat-list .s-l { color: var(--muted); }
.etk-stat-list .s-v { font-weight: 650; }
.etk-self td { background: var(--signal-soft); }

/* IA */
.etk-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; border: 1px solid var(--rule); border-radius: 8px; background: var(--rule); overflow: hidden; margin-bottom: 22px; }
.etk-engine { padding: 14px 16px; background: var(--panel); }
.etk-engine .e-name { font-weight: 650; display: block; margin-bottom: 6px; }
.etk-engine .e-big { font-size: 26px; font-weight: 650; line-height: 1.1; }
.etk-engine .e-small { font-size: 13px; color: var(--muted); }
.etk-bar { height: 8px; background: #edf1f5; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.etk-bar i { display: block; height: 100%; background: var(--data); }
.etk-sov li { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 48px; gap: 10px; align-items: center; padding: 6px 0; }
.etk-sov { list-style: none; margin: 0; padding: 0; }
.etk-sov .bar { height: 12px; background: #edf1f5; border-radius: 3px; overflow: hidden; }
.etk-sov .bar i { display: block; height: 100%; background: #9fb1c8; }
.etk-sov li.self .bar i { background: var(--signal); }
.etk-sov li.self .n { font-weight: 650; }
.etk-ans { font: inherit; border: 0; background: none; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 15px; line-height: 1; }
.etk-ans:hover, .etk-ans:focus-visible { background: #eef1f5; }
.etk-ans.c { color: #1b4c9e; } .etk-ans.m { color: var(--up); } .etk-ans.n { color: #a6b0bc; } .etk-ans.e { color: var(--warn); }
.etk-dots { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; }
.etk-dots i { width: 6px; height: 6px; border-radius: 50%; background: #d4dae2; }
.etk-dots i.m { background: var(--up); } .etk-dots i.c { background: #1b4c9e; }

/* diálogo */
.etk-dialog { border: 0; border-radius: 10px; padding: 0; max-width: min(760px, 94vw); width: 100%; color: var(--ink); box-shadow: 0 20px 60px rgba(15,39,66,.3); }
.etk-dialog::backdrop { background: rgba(15,39,66,.45); }
.etk-dialog header { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding: 18px 22px 0; }
.etk-dialog h3 { margin: 0; font-size: 17px; }
.etk-dialog .d-body { padding: 10px 22px 22px; max-height: 70vh; overflow: auto; }
.etk-dialog .d-text { white-space: pre-wrap; background: #f7f9fb; border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; font-size: 14px; }
.etk-dialog button.close { font: inherit; font-size: 22px; line-height: 1; border: 0; background: none; cursor: pointer; color: var(--muted); }

/* estados */
.etk-empty { text-align: left; padding: 22px; background: var(--panel); border: 1px dashed #c4cdd8; border-radius: 8px; color: var(--ink-2); }
.etk-empty h3 { margin: 0 0 6px; font-size: 16px; }
.etk-empty p { margin: 0; color: var(--muted); max-width: 70ch; }
.etk-error { padding: 10px 14px; background: #fbe7e4; color: #7c2318; border-radius: 6px; margin: 0 0 16px; font-size: 14px; }
.etk-loading { color: var(--muted); padding: 40px 0; }
.etk-timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--rule); }
.etk-timeline li { position: relative; padding: 0 0 12px 14px; }
.etk-timeline li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.etk-timeline time { display: block; color: var(--muted); font-size: 13px; }
.etk-foot { color: var(--muted); font-size: 13px; margin-top: 30px; }
.etk-btn { font: inherit; font-size: 14px; border: 1px solid var(--rule); background: #fff; color: var(--ink); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.etk-btn:hover { border-color: var(--ink-2); }

.etk-app :focus-visible { outline: 3px solid #f0a273; outline-offset: 2px; }

/* acceso (pantalla de entrada) */
.etk-login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.etk-login { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 32px; width: 100%; max-width: 420px; }
.etk-login h1 { font-size: 24px; margin: 8px 0 6px; }
.etk-login p { color: var(--muted); }
.etk-login-logo { max-height: 36px; }
.etk-login-brand { font-weight: 700; color: var(--ink) !important; margin: 0; }
.etk-login form p { margin: 0 0 14px; }
.etk-login label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.etk-login input[type=text], .etk-login input[type=password] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #c4cdd8; border-radius: 6px; }
.etk-login .login-remember label { display: inline; }
.etk-login input[type=submit] { font: inherit; font-weight: 600; background: var(--ink); color: #fff; border: 0; border-radius: 6px; padding: 11px 18px; cursor: pointer; width: 100%; }
.etk-login-help { font-size: 14px; }
.etk-login a { color: var(--data); }

@media (max-width: 860px) {
	.etk-local-layout { grid-template-columns: 1fr; }
	.etk-grid2 { grid-template-columns: 1fr; }
	.etk-kpis, .etk-engines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.etk-kpi:last-child:nth-child(odd), .etk-engine:last-child:nth-child(odd) { grid-column: span 2; }
	.etk-kpi { padding: 12px 14px; }
	.etk-kpi .k-val { font-size: 23px; }
	.etk-panel { padding: 16px 14px; }
	.etk-chart { height: 240px; }
	.etk-main { padding: 20px 14px 50px; }
	.etk-top { padding: 12px 14px; }
	.etk-tabs { padding: 0 8px; }
	.etk-map { height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
	.etk-app * { transition: none !important; animation: none !important; }
}
@media print {
	body.etk-body { background: #fff; }
	.etk-top .etk-periods, .etk-top select, .etk-top a, .etk-top button, .etk-tabs, .etk-filters, .etk-noprint, #adminmenumain, #wpadminbar, #wpfooter { display: none !important; }
	.etk-top { background: #fff; color: var(--ink); border-bottom: 2px solid var(--ink); padding: 0 0 10px; }
	.etk-main { padding: 16px 0; max-width: none; }
	.etk-panel, .etk-kpis { break-inside: avoid; }
	.etk-chart { height: 240px; }
	.etk-map { height: 420px; }
	#wpcontent { margin-left: 0 !important; }
}

.etk-updates { margin-top: 12px; font-size: 14px; }
.etk-updates summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }
.etk-updates ul { margin: 8px 0 6px 18px; padding: 0; }
.etk-updates li { margin: 3px 0; }
.etk-updates a { color: var(--data); text-decoration: none; }

.etk-point { font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #0f2742; }
.etk-point p { margin: 0 0 6px; }
.etk-point ol { margin: 0; padding-left: 22px; }
.etk-point li { margin: 0 0 7px; }
.etk-point li.self { background: #fdeee4; border-radius: 4px; padding: 2px 4px; }
.etk-point span { color: #5e6e80; }
.etk-point a { color: #2563c9; }

/* 1.3.0 · Rankings: primera columna fija, prioritarias, tendencia de volumen, por URL, Search Console */
.etk-sticky th:first-child, .etk-sticky td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; box-shadow: 1px 0 0 var(--rule); }
.etk-sticky td.kw { min-width: 180px; max-width: 320px; }
.etk-star { border: 0; background: none; padding: 0 4px 0 0; font-size: 16px; line-height: 1; color: #b7c0cb; cursor: pointer; }
span.etk-star { cursor: default; }
.etk-star.on { color: var(--signal); }
.etk-star:focus-visible, .etk-vol:focus-visible, .etk-link-btn:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; border-radius: 3px; }
.etk-vol { border: 0; background: none; padding: 0; font: inherit; color: var(--data); text-decoration: underline dotted; cursor: pointer; }
.etk-table td { position: relative; }
.etk-pop { position: absolute; right: 0; top: 100%; z-index: 5; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(15,39,66,.14); text-align: left; white-space: normal; width: 290px; }
.etk-pop svg { display: block; margin-top: 6px; max-width: 100%; height: auto; }
.etk-link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; word-break: break-all; }
.etk-link-btn::before { content: "▸ "; color: var(--muted); }
.etk-link-btn[aria-expanded=true]::before { content: "▾ "; }
.etk-sub-row td { background: #f7f9fb; font-size: 13px; color: var(--ink-2); }
.etk-sub-row td:first-child { position: static; box-shadow: none; }
.etk-dim .etk-pos { opacity: .55; }
.etk-rel { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.etk-rel.ok { background: #e3f3eb; color: var(--up); }
.etk-rel.mid { background: #fdf3df; color: var(--warn); }
.etk-rel.none { background: #eef1f5; color: var(--muted); }

/* 1.3.0 · Ficha de Google */
.etk-rev { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.etk-rev-big { font-size: 34px; font-weight: 700; line-height: 1.1; }
.etk-rev-big span { color: var(--g3); font-size: 26px; }
.etk-checks { list-style: none; margin: 0; padding: 0; }
.etk-checks li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf1f5; }
.etk-checks li:last-child { border-bottom: 0; }
.etk-checks .ico { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px; }
.etk-checks .ok .ico { background: var(--up); }
.etk-checks .warn .ico { background: var(--g3); }
.etk-checks .bad .ico { background: var(--down); }
@media (max-width: 640px) {
	.etk-sticky td.kw { min-width: 140px; max-width: 170px; }
	.etk-pop { width: 250px; }
}
