/* ============================================================
   GeoCenso · Movimientos en Campo
   Estilo vanguardista: tarjetas combinadas, glassmorphism, dark mode
   ============================================================ */

:root {
    --bg: #eef2f7;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-soft: #64748b;
    --border: #e2e8f0;
    --indigo: #4F46E5;
    --violet: #a855f7;
    --emerald: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --sky: #0284c7;
    --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.18);
}

body.dark-mode {
    --bg: #0b1220;
    --bg-card: #151e30;
    --text: #e5e9f0;
    --text-soft: #94a3b8;
    --border: #263349;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1200px 500px at 15% -10%, rgba(168,85,247,.10), transparent 60%),
        radial-gradient(1000px 450px at 100% 0%, rgba(79,70,229,.10), transparent 55%),
        var(--bg);
    color: var(--text);
    overflow: hidden;
    transition: background .3s, color .3s;
}

/* Pantalla completa (TV): todo el alto, ancho total, sin scroll */
.mov-wrapper {
    height: 100vh; width: 100%; max-width: none;
    display: flex; flex-direction: column;
    padding: 10px 18px 8px;
}

/* ---------- Cabecera ---------- */
.mov-header {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    flex-wrap: wrap; margin-bottom: 10px;
}
.mov-brand { display: flex; align-items: center; gap: 10px; }
.mov-logo {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, #4338ca, #4F46E5 45%, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
    box-shadow: 0 10px 24px -8px rgba(79,70,229,.55);
}
.mov-brand h1 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.mov-brand p { font-size: 11px; color: var(--text-soft); margin-top: 1px; }

/* Controles ocultos (Fecha, Refrescar, Auto, Modo noche) — se mantienen en el DOM para no romper el JS */
.mov-hidden-controls { display: none !important; }

/* Funciones centradas */
.mov-funciones {
    flex: 1; display: flex; justify-content: center; align-items: center;
    gap: 10px; flex-wrap: wrap;
}
.mov-acciones {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.mov-date-picker { display: flex; align-items: center; gap: 6px; }
.mov-date-picker label { font-size: 11px; color: var(--text-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mov-date-picker input {
    font-family: inherit; font-size: 13px; padding: 7px 10px; border-radius: 9px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}

.mov-btn-ghost, .mov-view-toggle button, .mov-btn-volver {
    font-family: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 14px; padding: 8px 12px;
    transition: transform .15s, box-shadow .15s, background .2s;
}
.mov-btn-ghost:hover, .mov-view-toggle button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.mov-view-toggle { display: flex; background: rgba(0,0,0,.05); border-radius: 10px; padding: 3px; }
.mov-view-toggle button { border: none; background: transparent; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 8px; }
.mov-view-toggle button.active { background: var(--bg-card); box-shadow: 0 1px 4px rgba(0,0,0,.12); color: var(--indigo); }

.mov-switch-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-soft); cursor: pointer; user-select: none; }
.mov-switch { position: relative; width: 34px; height: 19px; background: #cbd5e1; border-radius: 999px; transition: background .2s; }
.mov-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: left .2s; }
.mov-switch-label input { display: none; }
.mov-switch-label input:checked + .mov-switch { background: var(--indigo); }
.mov-switch-label input:checked + .mov-switch::after { left: 17px; }

.mov-btn-volver {
    text-decoration: none; font-weight: 600; font-size: 12.5px;
    background: linear-gradient(135deg, #4338ca, #4F46E5 50%, #a855f7); color: #fff; border: none;
    padding: 9px 16px; box-shadow: 0 8px 18px -8px rgba(79,70,229,.55);
}

.mov-btn-global {
    text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
    font-weight: 800; font-size: 12.5px; letter-spacing: .02em; color: #fff;
    padding: 9px 18px; border-radius: 10px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 50%, #4F46E5 100%);
    box-shadow: 0 0 18px -4px rgba(14,116,144,.75), inset 0 0 0 1px rgba(255,255,255,.12);
    transition: transform .15s, box-shadow .15s;
}
.mov-btn-global:hover { transform: translateY(-1px); box-shadow: 0 0 26px -2px rgba(8,145,178,.9); }

/* ---------- KPIs (compactos) ---------- */
.mov-kpis {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 10px;
}
.mov-kpi {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.mov-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px rgba(15,23,42,.25); }
.mov-kpi.active { outline: 2px solid var(--indigo); outline-offset: 1px; }
.mov-kpi-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.mov-kpi-val { font-size: 18px; font-weight: 800; line-height: 1; }
.mov-kpi-lbl { font-size: 10px; color: var(--text-soft); font-weight: 600; margin-top: 2px; }

/* ---------- Ecualizador de Actividad (área principal full-screen) ---------- */
.eq-card {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    background: transparent; border: none; box-shadow: none;
    padding: 4px 2px; margin-bottom: 0;
}
.eq-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.eq-title { display: flex; align-items: center; gap: 10px; }
.eq-title-ico { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #4338ca, #4F46E5 45%, #a855f7); display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 8px 18px -8px rgba(79,70,229,.5); }
.eq-title-txt { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.eq-title-sub { font-size: 11.5px; color: var(--text-soft); margin-top: 1px; }

.eq-empresas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.eq-emp-btn {
    font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-soft); transition: all .15s;
}
.eq-emp-btn:hover { color: var(--indigo); border-color: var(--indigo); }
.eq-emp-btn.active {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, #4338ca, #4F46E5 50%, #a855f7);
    box-shadow: 0 4px 12px -4px rgba(79,70,229,.6);
}

.eq-bars {
    flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 5px; padding: 6px 2px 0;
    background-image: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent calc(25% - 1px),
        rgba(100,116,139,.13) calc(25% - 1px),
        rgba(100,116,139,.13) 25%
    );
}
.eq-col { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; padding-top: 24px; }
.eq-seg {
    width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; position: relative;
    transition: height .55s cubic-bezier(.34,1.56,.64,1);
}
.eq-seg:hover { filter: brightness(1.2); }
.eq-total {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
    padding: 3px 7px; border-radius: 999px; white-space: nowrap;
    color: var(--text); background: rgba(255,255,255,.85);
    border: 1px solid rgba(100,116,139,.18);
    box-shadow: 0 4px 12px -6px rgba(15,23,42,.25);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; animation: eqPop .4s ease .7s forwards;
}
.eq-col.pico .eq-total {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, #4338ca, #4F46E5 50%, #a855f7);
    box-shadow: 0 6px 16px -6px rgba(79,70,229,.55);
}
.eq-val {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-size: 9px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,.95); text-shadow: 0 1px 2px rgba(0,0,0,.45);
    pointer-events: none; white-space: nowrap;
    opacity: 0; animation: eqPop .4s ease .7s forwards;
}
@keyframes eqPop { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.eq-total { animation-name: eqPopTop; }
@keyframes eqPopTop { from { opacity: 0; transform: translateX(-50%) translateY(4px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.eq-col.pico .eq-seg { box-shadow: 0 0 14px 0 rgba(79,70,229,.22); }
.eq-col.cero { background: transparent; }
.eq-col.cero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: rgba(100,116,139,.18); border-radius: 2px;
}
.eq-labels { display: flex; gap: 5px; margin-top: 5px; }
.eq-label { flex: 1; text-align: center; font-size: 11px; color: var(--text-soft); font-weight: 700; }
.eq-leyenda { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.eq-ley-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-soft); font-weight: 600; }
.eq-ley-item i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.eq-meta { margin-top: 8px; font-size: 12.5px; color: var(--text-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eq-meta b { color: var(--violet); font-weight: 800; }
.eq-meta .eq-pico { color: var(--indigo); font-weight: 700; }
.eq-empty { color: #94a3b8; font-size: 12.5px; }

/* ---------- Filtros ---------- */
.mov-filters {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px;
    padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.mov-filter { display: flex; flex-direction: column; gap: 4px; }
.mov-filter label { font-size: 11px; color: var(--text-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.mov-filter select, .mov-filter input {
    font-family: inherit; font-size: 13px; padding: 8px 10px; border-radius: 9px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text); min-width: 150px;
}
.mov-filter-search { flex: 1; }
.mov-filter-search input { width: 100%; }
.mov-chip-filter {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
    color: #fff; background: var(--indigo); padding: 7px 12px; border-radius: 999px;
}

/* ---------- Grilla de tarjetas combinadas ---------- */
.mov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.mov-card {
    position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
    transition: transform .18s, box-shadow .18s;
}
.mov-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(15,23,42,.3); }
.mov-card-top { padding: 16px 18px; display: flex; gap: 13px; align-items: center; }
.mov-avatar {
    width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #fff;
    background: linear-gradient(135deg, var(--c1, #4F46E5), var(--c2, #a855f7));
}
.mov-avatar-wrap { position: relative; }
.mov-dot {
    position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%;
    border: 2.5px solid var(--bg-card);
}
.mov-dot.verde { background: var(--emerald); animation: pulso 2s infinite; }
.mov-dot.amarillo { background: var(--amber); animation: pulso 2s infinite; }
.mov-dot.naranja { background: #fb923c; animation: pulsoN 2s infinite; }
.mov-dot.rojo { background: var(--red); }
@keyframes pulso { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4);} 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0);} }
.mov-dot.amarillo { animation-name: pulsoA; }
@keyframes pulsoA { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.4);} 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0);} }
@keyframes pulsoN { 0%,100% { box-shadow: 0 0 0 0 rgba(251,146,60,.5);} 50% { box-shadow: 0 0 0 6px rgba(251,146,60,0);} }

.mov-card-name { font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; }
.mov-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mov-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 8px; border-radius: 999px;
}
.mov-badge.vendedor { background: rgba(2,132,199,.12); color: var(--sky); }
.mov-badge.promotor { background: rgba(168,85,247,.12); color: var(--violet); }
.mov-badge.chofer { background: rgba(245,158,11,.12); color: var(--amber); }
.mov-badge.supervisor { background: rgba(79,70,229,.12); color: var(--indigo); }
.mov-empresa { font-size: 11px; color: var(--text-soft); }

.mov-chip-estado {
    margin: 0 18px 14px; display: inline-flex; align-items: center; gap: 7px;
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 6px 12px; border-radius: 999px;
}
.mov-chip-estado.verde { background: rgba(16,185,129,.12); color: #059669; }
.mov-chip-estado.naranja { background: rgba(251,146,60,.12); color: #c2410c; }
.mov-chip-estado.amarillo { background: rgba(245,158,11,.12); color: #b45309; }
.mov-chip-estado.rojo { background: rgba(239,68,68,.12); color: #dc2626; }

.mov-stats {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 18px 14px;
}
.mov-stat {
    background: linear-gradient(135deg, rgba(79,70,229,.06), rgba(168,85,247,.04));
    border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.mov-stat-val { font-size: 17px; font-weight: 800; }
.mov-stat-lbl { font-size: 10px; color: var(--text-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

.mov-feed { border-top: 1px solid var(--border); padding: 12px 18px 14px; }
.mov-feed-t { font-size: 10.5px; color: var(--text-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.mov-feed-item { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; padding: 4px 0; }
.mov-feed-ico { width: 24px; height: 24px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.mov-feed-ico.entrada_app { background: rgba(79,70,229,.12); }
.mov-feed-ico.visita { background: rgba(2,132,199,.12); }
.mov-feed-ico.ejecucion { background: rgba(168,85,247,.12); }
.mov-feed-ico.store_check { background: rgba(14,165,233,.12); }
.mov-feed-ico.plan_slep { background: rgba(192,132,252,.12); }
.mov-feed-ico.inspeccion { background: rgba(16,185,129,.12); }
.mov-feed-ico.acompanamiento { background: rgba(245,158,11,.12); }
.mov-feed-ico.pac_cerrado { background: rgba(239,68,68,.12); }
.mov-feed-time { color: var(--text-soft); font-size: 11px; margin-left: auto; white-space: nowrap; }
.mov-ver-mas { text-align: center; padding: 9px; font-size: 12px; font-weight: 700; color: var(--indigo); border-top: 1px solid var(--border); }

/* ---------- Tabla ---------- */
.mov-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.mov-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mov-table th {
    text-align: left; padding: 13px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-soft); border-bottom: 1px solid var(--border); background: rgba(0,0,0,.02);
}
.mov-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.mov-table tr:last-child td { border-bottom: none; }
.mov-table tr:hover td { background: rgba(79,70,229,.04); }
.mov-td-user { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mov-avatar-sm { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: #fff; background: linear-gradient(135deg, #4F46E5, #a855f7); }
.mov-td-estado { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.mov-td-estado i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mov-td-estado .verde { background: var(--emerald); } .mov-td-estado .amarillo { background: var(--amber); } .mov-td-estado .rojo { background: var(--red); }

/* ---------- Vacío / footer ---------- */
.mov-empty { text-align: center; padding: 60px 20px; color: var(--text-soft); }
.mov-empty div { font-size: 42px; margin-bottom: 10px; }
.mov-empty p { font-size: 14px; }
.mov-footer { text-align: center; font-size: 11.5px; color: var(--text-soft); margin-top: 28px; }

/* ---------- Modal ---------- */
.mov-modal {
    position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 18px;
}
.mov-modal-card {
    background: var(--bg-card); border-radius: 20px; max-width: 560px; width: 100%; max-height: 86vh;
    overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
}
.mov-modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(168,85,247,.05));
}
.mov-modal-close { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text-soft); line-height: 1; }
.mov-modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px; }
.mov-modal-stats .mov-stat { text-align: center; }
.mov-timeline { padding: 6px 20px 20px; overflow-y: auto; }
.mov-tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.mov-tl-item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: -2px; width: 2px; background: var(--border); }
.mov-tl-item:last-child::before { display: none; }
.mov-tl-ico { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; z-index: 1; }
.mov-tl-ico.entrada_app { background: rgba(79,70,229,.14); }
.mov-tl-ico.visita { background: rgba(2,132,199,.14); }
.mov-tl-ico.ejecucion { background: rgba(168,85,247,.14); }
.mov-tl-ico.store_check { background: rgba(14,165,233,.14); }
.mov-tl-ico.plan_slep { background: rgba(192,132,252,.14); }
.mov-tl-ico.inspeccion { background: rgba(16,185,129,.14); }
.mov-tl-ico.acompanamiento { background: rgba(245,158,11,.14); }
.mov-tl-ico.pac_cerrado { background: rgba(239,68,68,.14); }
.mov-tl-body { flex: 1; }
.mov-tl-title { font-size: 13px; font-weight: 700; }
.mov-tl-sub { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }
.mov-tl-time { font-size: 11px; color: var(--text-soft); font-weight: 600; margin-top: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .mov-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 900px) {
    body { overflow: auto; }
    .mov-wrapper { height: auto; min-height: 100vh; max-width: 680px; margin: 0 auto; }
    .mov-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .eq-val { display: none; }

    /* Tablet / móvil grande: botones satélite más grandes y parejos (2 columnas) */
    .mov-funciones {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        justify-items: stretch;
        margin-bottom: 14px;
    }
    .mov-funciones .mov-btn-global {
        justify-content: center;
        text-align: center;
        font-size: 14px;
        padding: 14px 12px;
        width: 100%;
    }
    .mov-funciones #mov-btn-precios {
        grid-column: 1 / -1;
        font-size: 15px;
        padding: 16px 12px;
    }

    /* KPIs: 3 columnas, tarjetas más grandes */
    .mov-kpis {
        grid-template-columns: repeat(3, 1fr);
        gap: 9px;
        width: 100%;
        max-width: none;
        margin: 0 0 14px;
    }
    .mov-kpi {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
        padding: 14px 8px;
    }
    .mov-kpi-ico { width: 38px; height: 38px; font-size: 18px; }
    .mov-kpi-val { font-size: 22px; }
    .mov-kpi-lbl { font-size: 11px; }
}
@media (max-width: 560px) {
    body { overflow: auto; }
    .mov-wrapper { height: auto; min-height: 100vh; }
    .mov-grid { grid-template-columns: 1fr; }
    /* Vista móvil: mostrar solo botones y KPIs, ocultar el gráfico (con su leyenda y detalle) */
    .eq-card { display: none; }
    .mov-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .mov-brand { justify-content: center; }
    .mov-acciones { justify-content: center; align-items: center; }
    .mov-date-picker { justify-content: center; }

    /* Botones satélite: grid de 2 columnas, parejos y más grandes */
    .mov-funciones {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        justify-items: stretch;
        margin-bottom: 14px;
    }
    .mov-funciones .mov-btn-global {
        justify-content: center;
        text-align: center;
        font-size: 15px;
        padding: 16px 14px;
        width: 100%;
    }
    /* Precios Globales: todo el ancho, más llamativo */
    .mov-funciones #mov-btn-precios {
        grid-column: 1 / -1;
        font-size: 16px;
        padding: 18px 14px;
    }

    /* KPIs: 3 columnas, tarjetas más grandes y táctiles */
    .mov-kpis {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        max-width: none;
        margin: 0 0 14px;
    }
    .mov-kpi {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        padding: 18px 10px;
    }
    .mov-kpi-ico { width: 42px; height: 42px; font-size: 20px; }
    .mov-kpi-val { font-size: 24px; }
    .mov-kpi-lbl { font-size: 11px; }

    .eq-head { justify-content: center; }
    .eq-title { justify-content: center; text-align: center; }
    .eq-empresas, .eq-leyenda, .eq-meta { justify-content: center; }
    .eq-labels { justify-content: center; }
    .eq-bars { height: 110px; gap: 3px; }
    .eq-col { padding-top: 18px; }
    .eq-total { font-size: 9px; padding: 2px 5px; }
}

/* ============================================================
   Precios Globales (Cuadro de Mando · estilo bolsa de valores)
   ============================================================ */
.pg-modal {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 16px 24px 24px;
}
body.dark-mode .pg-modal { background: rgba(2,6,23,.7); }

.pg-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,.55);
    border: 1px solid var(--border);
}

.pg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(168,85,247,.06));
    border-bottom: 1px solid var(--border);
}
.pg-head h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.pg-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-soft);
    line-height: 1;
    transition: color .15s ease, transform .15s ease;
}
.pg-close:hover { color: var(--red); transform: scale(1.15); }

.pg-quadrant {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    margin: 0 24px 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.pg-quadrant-table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.price-ticker-table.consolidated-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}
.price-ticker-table.consolidated-table th {
    background: var(--bg-card);
    color: var(--text);
    padding: 9px 8px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
body.dark-mode .price-ticker-table.consolidated-table th { background: #1a2440; }
.price-ticker-table.consolidated-table td {
    padding: 9px 8px;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.price-ticker-table.consolidated-table tbody tr:hover td {
    background: rgba(79,70,229,.05);
}

.cell-price-min { color: #dc2626 !important; font-weight: 600; }
.cell-price-avg { color: #d97706 !important; font-weight: 600; }
.cell-price-max { color: #16a34a !important; font-weight: 600; }
.cell-price-avg-gen { color: #2563eb !important; font-weight: 800; }
.cell-sinc { color: var(--text-soft) !important; font-size: 10px !important; }
.col-divider { border-right: 1px solid var(--border) !important; }
