/* =========================================================================
   MP Landing Manager — Dashboard de cliente / agencia
   Sistema visual profesional. Solo CSS (sin fuentes ni assets externos).
   Tokens de color e ink alineados con guía de dataviz.
   ========================================================================= */

.mplm-dash {
	/* Marca */
	--b: #2a78d6;
	--b-strong: #1c5cab;
	--b2: #4a3aa7;
	/* Superficies e ink */
	--plane: #f7f8fa;
	--surface: #ffffff;
	--ink: #0b0b0b;
	--ink-2: #52514e;
	--muted: #898781;
	--line: rgba(11, 11, 11, .09);
	--line-2: #eceef1;
	--grid: #e6e8ec;
	/* Sombras (finas, en capas) */
	--sh-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
	--sh-md: 0 2px 4px rgba(16, 24, 40, .04), 0 8px 20px rgba(16, 24, 40, .06);
	--sh-lg: 0 12px 32px rgba(16, 24, 40, .12);
	--r: 14px;
	--r-lg: 18px;

	max-width: 1440px;
	margin: 0 auto;
	padding: 26px 28px 56px;
	color: var(--ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.mplm-dash * { box-sizing: border-box; }
body:has(.mplm-dash) { background: var(--plane); }

/* El panel ocupa todo el ancho: neutraliza el contenedor estrecho del tema. */
.mp-wrap:has(.mplm-dash),
main:has(.mplm-dash),
.entry-content:has(.mplm-dash),
article:has(.mplm-dash) {
	max-width: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}
/* Oculta el título de página que imprime el tema encima del panel. */
article:has(.mplm-dash) .mp-site-title,
main:has(.mplm-dash) > .mp-site-title,
.mp-wrap:has(.mplm-dash) > .mp-site-title { display: none !important; }

/* Tipografía base */
.mplm-dash h1, .mplm-dash h2, .mplm-dash h3 { letter-spacing: -.01em; }

/* =========================================================================
   HERO
   ========================================================================= */
.mplm-hero {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	padding: 22px 26px;
	margin-bottom: 22px;
	border-radius: 20px;
	background:
		radial-gradient(140% 180% at 0% 0%, #1a2350 0%, transparent 55%),
		linear-gradient(120deg, #0b1220 0%, #131a35 48%, #1b1440 100%);
	box-shadow: var(--sh-lg);
	isolation: isolate;
}
.mplm-hero-glow {
	position: absolute; width: 380px; height: 380px; top: -170px; left: -70px;
	background: radial-gradient(circle, rgba(250, 204, 21, .42), rgba(99, 102, 241, .30) 42%, transparent 70%);
	filter: blur(26px); z-index: -1;
	animation: mplm-float 10s ease-in-out infinite;
}
@keyframes mplm-float { 0%,100% { transform: none; opacity: .8; } 50% { transform: translate(52px, 26px) scale(1.12); opacity: 1; } }

.mplm-hero-brand { display: flex; align-items: center; gap: 15px; }
.mplm-logo-mark { width: 50px; height: 50px; flex-shrink: 0; filter: drop-shadow(0 6px 16px rgba(250, 204, 21, .45)); animation: mplm-bolt 5s ease-in-out infinite; }
@keyframes mplm-bolt { 0%,93%,100% { filter: drop-shadow(0 6px 16px rgba(250, 204, 21, .45)); } 96% { filter: drop-shadow(0 6px 24px rgba(253, 224, 71, 1)) brightness(1.18); } }
.mplm-hero-word { display: flex; flex-direction: column; line-height: 1; }
.mplm-wordmark {
	font-size: 23px; font-weight: 800; letter-spacing: .16em;
	background: linear-gradient(90deg, #fff 42%, #fde68a 76%, #f59e0b);
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.mplm-wordmark b { font-weight: 900; }
.mplm-hero-tag { margin-top: 7px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #93a3c9; display: flex; align-items: center; gap: 6px; }
.mplm-hero-tag .bi { color: #facc15; }

.mplm-hero-right { display: flex; align-items: center; gap: 12px; }
.mplm-client-chip {
	display: flex; align-items: center; gap: 10px; padding: 7px 15px 7px 7px;
	background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13);
	border-radius: 999px; backdrop-filter: blur(6px);
}
.mplm-chip-logo { height: 30px; width: auto; border-radius: 6px; background: #fff; padding: 2px 4px; }
.mplm-chip-av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #3b2f00; background: linear-gradient(135deg, #fde047, #f59e0b); }
.mplm-chip-txt { display: flex; flex-direction: column; line-height: 1.15; }
.mplm-chip-txt small { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #93a3c9; }
.mplm-chip-txt strong { font-size: 14px; color: #fff; font-weight: 700; }
.mplm-hero-logout {
	width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
	border-radius: 12px; color: #cbd5e1; font-size: 18px;
	background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
	text-decoration: none; transition: background .15s, color .15s, transform .15s;
}
.mplm-hero-logout:hover { background: #d03b3b; color: #fff; transform: translateY(-1px); border-color: transparent; }

/* Volver (agencia) */
.mplm-backbar {
	display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
	font-weight: 600; font-size: 13px; color: var(--b); text-decoration: none;
	padding: 7px 14px; border-radius: 999px; background: var(--surface);
	border: 1px solid var(--line); box-shadow: var(--sh-sm);
	transition: transform .12s, box-shadow .12s;
}
.mplm-backbar:hover { transform: translateX(-2px); box-shadow: var(--sh-md); color: var(--b-strong); }

/* =========================================================================
   NAV (pestañas)
   ========================================================================= */
.mplm-nav { gap: 6px; margin-bottom: 18px !important; }
.mplm-nav .nav-link {
	color: var(--ink-2); font-weight: 600; font-size: 13.5px; border-radius: 11px;
	padding: 9px 16px; display: flex; align-items: center; gap: 7px; border: 1px solid transparent;
	transition: background .12s, color .12s, box-shadow .12s;
}
.mplm-nav .nav-link:hover { background: #eef2f8; color: var(--ink); }
.mplm-nav .nav-link.active { background: var(--b); color: #fff; box-shadow: 0 6px 16px rgba(42, 120, 214, .28); }

/* =========================================================================
   SELECTOR DE RANGO
   ========================================================================= */
.mplm-rangebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.mplm-range-btns, .mplm-range-custom { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-sm); }
.mplm-range-btns { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; }
.mplm-range-btn { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 6px 12px; border-radius: 8px; text-decoration: none; white-space: nowrap; transition: background .12s, color .12s; }
.mplm-range-btn:hover { background: #eef2f8; color: var(--ink); }
.mplm-range-btn.active { background: var(--b); color: #fff; box-shadow: 0 3px 10px rgba(42, 120, 214, .3); }
.mplm-range-custom { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; }
.mplm-range-custom .bi { color: var(--muted); }
.mplm-range-custom.active { border-color: var(--b); box-shadow: 0 0 0 3px rgba(42, 120, 214, .14); }
.mplm-range-custom input[type=date] { width: auto; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; padding: 5px 8px; color: var(--ink); }
.mplm-range-custom span { color: var(--muted); }
.mplm-range-tag { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: #eef2f8; padding: 4px 11px; border-radius: 999px; letter-spacing: .01em; }

/* =========================================================================
   KPIs
   ========================================================================= */
.mplm-kpis { margin-bottom: 4px; }
.mplm-kpi {
	display: flex; align-items: center; gap: 14px; height: 100%;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
	padding: 18px 20px; box-shadow: var(--sh-sm);
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
.mplm-kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: rgba(42, 120, 214, .28); }
.mplm-kpi-ico {
	flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px;
	display: flex; align-items: center; justify-content: center; font-size: 20px;
	background: color-mix(in srgb, currentColor 13%, #fff);
}
/* Colores de acento por KPI (Bootstrap text-*) sobre el chip tintado */
.mplm-kpi-ico.text-primary { color: var(--b) !important; }
.mplm-kpi-ico.text-info { color: #0e7490 !important; }
.mplm-kpi-ico.text-success { color: #0ca30c !important; }
.mplm-kpi-ico.text-warning { color: #eda100 !important; }
.mplm-kpi-body { min-width: 0; }
.mplm-kpi-num { display: block; font-size: 27px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.mplm-kpi-label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 500; }

/* Comparativa ▲▼ */
.mplm-delta { display: inline-flex; align-items: center; gap: 0; font-size: 10.5px; font-weight: 700; padding: 1px 6px 1px 4px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.mplm-delta .bi { font-size: 13px; }
.mplm-delta-up { background: #dff5df; color: #006300; }
.mplm-delta-down { background: #fde4e4; color: #b42121; }
.mplm-delta-flat { background: #eef1f4; color: var(--muted); }

/* =========================================================================
   DISPOSITIVO
   ========================================================================= */
.mplm-devices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.mplm-device { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px 17px; box-shadow: var(--sh-sm); }
.mplm-device-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.mplm-device-top > span { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.mplm-device-top .bi { color: var(--muted); }
.mplm-device-top strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.mplm-device-bar { height: 6px; border-radius: 999px; background: #eef1f4; margin: 9px 0 6px; overflow: hidden; }
.mplm-device-bar span { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.22,.61,.36,1); }
.mplm-device small { color: var(--muted); font-size: 11.5px; }

/* =========================================================================
   PANELES
   ========================================================================= */
.mplm-panel { height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-sm); }
.mplm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.mplm-panel-head h2 { font-size: 14px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.mplm-panel-head h2 .bi { color: var(--b); font-size: 15px; }

/* Gráficas — altura fija */
.mplm-chart-box { position: relative; width: 100%; height: 300px; }
.mplm-chart-box--sm { height: 280px; }
.mplm-chart-box canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
@media (max-width: 575.98px) { .mplm-chart-box { height: 240px; } .mplm-chart-box--sm { height: 260px; } }

/* =========================================================================
   TABLAS
   ========================================================================= */
.mplm-table { font-size: 13.5px; }
.mplm-table thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.mplm-table td { border-color: var(--line-2); padding-top: 11px; padding-bottom: 11px; color: var(--ink-2); }
.mplm-table td.fw-semibold { color: var(--ink); }
.mplm-table td.text-end { font-variant-numeric: tabular-nums; }
.mplm-table tbody tr { transition: background .12s; }
.mplm-table tbody tr:hover { background: #f7f9fc; }
.mplm-table .badge { font-weight: 600; }

/* =========================================================================
   LEADS RECIENTES
   ========================================================================= */
.mplm-recent li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.mplm-recent li:last-child { border-bottom: 0; }
.mplm-recent-av { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--b), var(--b2)); }
.mplm-recent-main { flex: 1; min-width: 0; }
.mplm-recent-main strong { display: block; font-size: 13.5px; color: var(--ink); }
.mplm-recent-main span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mplm-recent-meta { text-align: right; }
.mplm-recent-meta small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Pie tabla leads (info + paginador) */
.mplm-leads-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.mplm-leads-info { font-size: 12.5px; color: var(--muted); }
.mplm-leads-pager .pagination { --bs-pagination-color: var(--ink-2); --bs-pagination-active-bg: var(--b); --bs-pagination-active-border-color: var(--b); gap: 4px; }
.mplm-leads-pager .page-link { border-radius: 9px !important; border-color: var(--line); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.mplm-leads-pager .page-item.active .page-link { box-shadow: 0 4px 12px rgba(42, 120, 214, .28); }

/* Buscador (agencia) */
.mplm-search { position: relative; }
.mplm-search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.mplm-search input { padding-left: 33px; min-width: 230px; border-radius: 10px; border-color: var(--line-2); font-size: 13.5px; }
.mplm-cli-cell { display: flex; align-items: center; gap: 11px; }
.mplm-cli-logo { height: 30px; width: auto; max-width: 82px; border-radius: 6px; }
.mplm-cli-av { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--b), var(--b2)); }

/* Badges de estado (Bootstrap subtle) — refinado */
.badge.bg-light { background: #eef1f4 !important; color: var(--ink-2) !important; font-weight: 600; }

/* =========================================================================
   ANIMACIONES DE ENTRADA
   ========================================================================= */
.mplm-anim { opacity: 0; transform: translateY(12px); animation: mplm-in .5s cubic-bezier(.22,.61,.36,1) forwards; animation-delay: var(--d, 0s); }
@keyframes mplm-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mplm-anim { animation: none; opacity: 1; transform: none; } .mplm-device-bar span { transition: none; } }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 575.98px) {
	.mplm-dash { padding: 18px 12px 40px; }
	.mplm-kpi { padding: 15px; gap: 12px; }
	.mplm-kpi-num { font-size: 23px; }
	.mplm-devices { grid-template-columns: 1fr; }
	.mplm-hero { padding: 18px; }
	.mplm-wordmark { font-size: 20px; }
}

/* Avisos (notice) */
.mplm-portal, .mplm-dash .mplm-panel.text-center { }
