/* =====================================================
   Plat_MonsterAdhoc — Design System para páginas internas
   Paleta verde #70AD47 con gradient hacia teal #1B9AAA
   ===================================================== */

:root {
    --adhoc-primary: #70AD47;
    --adhoc-gradient: linear-gradient(135deg, #70AD47 0%, #1B9AAA 100%);

    /* Dark mode (default) */
    --bg-primary: #0f1812;
    --bg-secondary: #1a2520;
    --bg-card: #152019;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #EAF4EC;
    --text-secondary: #9AB0A1;
    --border-color: #2a3b32;
    --border-glow: rgba(112, 173, 71, 0.35);

    --topbar-height: 64px;
}

.light-mode {
    --bg-primary: #EAF1E7;
    --bg-secondary: #FFFFFF;
    --bg-card: #F4F9F1;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-hover: rgba(255, 255, 255, 0.92);
    --text-primary: #2A3B32;
    --text-secondary: #6A7D71;
    --border-color: #D4E0CF;
    --border-glow: rgba(112, 173, 71, 0.30);
}

/* Cuando la Monitoreo está activa permitimos scroll normal */
html:has(.adhoc-app),
body:has(.adhoc-app) {
    overflow: auto;
    height: 100%;
    background: var(--bg-primary);
}

.adhoc-app {
    height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow: hidden; /* el scroll-y vive en .adhoc-main */
    position: relative; /* ancla el .adhoc-vscroll-wrap (position:absolute) */
}

/* =====================================================
   TopBar
   ===================================================== */
.adhoc-topbar {
    height: var(--topbar-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
}

.adhoc-topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--adhoc-gradient);
    opacity: 0.55;
    pointer-events: none;
}

.adhoc-topbar-left,
.adhoc-topbar-right {
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 1;
}

.adhoc-topbar-right { gap: 12px; }

/* Centro absoluto: el saludo permanece centrado en viewport
   sin importar el ancho de los slots laterales */
.adhoc-topbar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 0;
}

.adhoc-topbar-greeting {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.3px;
    pointer-events: auto;
}

.adhoc-topbar-greeting strong {
    font-weight: 700;
    background: var(--adhoc-gradient-warm);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Píldora con fondo blanco para que logos oscuros se lean sobre el topbar
   (en modo claro se vuelve transparente porque los logos suelen ser oscuros
   y el topbar ya es claro) */
.adhoc-topbar-client-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.light-mode .adhoc-topbar-client-pill {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.adhoc-topbar-client-logo {
    max-height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Botón Logout — mismo lenguaje que theme-toggle */
.adhoc-topbar-logout {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.adhoc-topbar-logout:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
    color: var(--adhoc-primary);
    transform: translateX(2px);
}

.adhoc-topbar-logout:active {
    transform: translateX(2px) scale(0.96);
}

.adhoc-topbar-logo {
    height: 28px;
    width: auto;
    display: block;
    transition: filter 0.25s ease, transform 0.25s ease;
    filter: invert(1) hue-rotate(180deg) drop-shadow(0 2px 6px rgba(112, 173, 71, 0.25));
}

.light-mode .adhoc-topbar-logo {
    filter: drop-shadow(0 2px 6px rgba(112, 173, 71, 0.15));
}

.adhoc-topbar-logo:hover { transform: scale(1.04); }

/* =====================================================
   Theme Toggle
   ===================================================== */
.theme-toggle-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.theme-toggle-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
    color: var(--adhoc-primary);
    transform: rotate(15deg);
}

.theme-icon { display: block; }

/* =====================================================
   Main wrapper — ocupa todo el alto/ancho disponible
   ===================================================== */
.adhoc-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
    /* Nativo oculto: scroll-y custom en .adhoc-vscroll-wrap */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.adhoc-main::-webkit-scrollbar {
    display: none;
    width: 0;
}

.adhoc-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: calc(100vh - var(--topbar-height) - 32px);
}

/* Row de nivel superior: stack izquierdo (calendario + galería) + card mapa
   como hermano a la derecha. Cuando .has-mapa-open, el mapa expande de
   flex-basis 0 a 42% y el stack ajusta a 58% via flex:1.
   `align-items: stretch` para que el stack ocupe todo el alto del row (y la
   galería con flex:1 pueda crecer al height completo del viewport). El panel
   se sale del stretch con su propio align-self más abajo. */
.adhoc-main-row {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.adhoc-main-stack {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =====================================================
   Scrollbar vertical custom — gradient real
   (posicionado sobre el lado derecho del app)
   ===================================================== */
.adhoc-vscroll-wrap {
    position: absolute;
    top: calc(var(--topbar-height) + 14px);
    right: 6px;
    bottom: 14px;
    width: 12px;
    z-index: 50;
}

.adhoc-vscroll-track {
    position: relative;
    width: 12px;
    height: 100%;
    background: linear-gradient(180deg, rgba(112, 173, 71, 0.28) 0%, rgba(27, 154, 170, 0.28) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
}

.light-mode .adhoc-vscroll-track {
    background: linear-gradient(180deg, rgba(112, 173, 71, 0.18) 0%, rgba(27, 154, 170, 0.18) 100%);
}

.adhoc-vscroll-thumb {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 20%;
    background: linear-gradient(180deg, #70AD47 0%, #1B9AAA 100%);
    border-radius: 10px;
    box-shadow:
        0 0 10px rgba(112, 173, 71, 0.35),
        inset 1px 0 0 rgba(255, 255, 255, 0.20);
    cursor: grab;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
    will-change: top, height;
}

.adhoc-vscroll-thumb:hover {
    filter: brightness(1.10) saturate(1.1);
    box-shadow:
        0 0 14px rgba(112, 173, 71, 0.50),
        inset 1px 0 0 rgba(255, 255, 255, 0.25);
}

.adhoc-vscroll-thumb:active {
    cursor: grabbing;
}

/* =====================================================
   Back to Top — botón flotante circular
   Aparece cuando .adhoc-main scrollea más allá del threshold;
   smooth-scroll se maneja en JS (adhocScroll.initBackToTop).
   ===================================================== */
.adhoc-back-to-top {
    position: absolute;
    bottom: 24px;
    right: 28px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--adhoc-gradient-warm);
    color: #fff;
    cursor: pointer;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(18px) scale(0.85);
    pointer-events: none;
    box-shadow:
        0 10px 24px rgba(112, 173, 71, 0.45),
        0 4px 10px rgba(27, 154, 170, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.30);
    transition:
        opacity 0.28s ease,
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.adhoc-back-to-top::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(184, 216, 74, 0.55);
    opacity: 0;
    pointer-events: none;
    animation: adhocBackToTopPulse 2.2s ease-out infinite;
}

.adhoc-back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.adhoc-back-to-top.is-visible::before {
    opacity: 1;
}

.adhoc-back-to-top:hover {
    transform: translateY(-3px) scale(1.06);
    filter: brightness(1.06) saturate(1.08);
    box-shadow:
        0 14px 30px rgba(112, 173, 71, 0.55),
        0 6px 14px rgba(27, 154, 170, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.adhoc-back-to-top:active {
    transform: translateY(-1px) scale(0.98);
    transition-duration: 0.08s;
}

.adhoc-back-to-top svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
    transition: transform 0.2s ease;
}

.adhoc-back-to-top:hover svg {
    transform: translateY(-2px);
}

@keyframes adhocBackToTopPulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    70%  { transform: scale(1.18); opacity: 0; }
    100% { transform: scale(1.18); opacity: 0; }
}

/* =====================================================
   Card genérico
   — el calendario es compacto (altura por contenido),
     los cards posteriores (imágenes) crecerán con flex: 1
   ===================================================== */
.adhoc-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.30);
    min-height: 0;
}

.adhoc-card-grow {
    flex: 1;
    min-height: 500px;
}

.light-mode .adhoc-card {
    box-shadow: 0 2px 14px rgba(42, 59, 50, 0.08);
}

.adhoc-card-header {
    background: var(--adhoc-gradient);
    color: white;
    padding: 14px 20px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.adhoc-card-header-with-summary {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    position: relative;  /* para centrar el slot de campaña en absoluto */
}

/* Campaña activa — centrada horizontalmente entre title (izq) y summary (der) */
.adhoc-card-header-campaign {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;  /* deja pasar el click al header excepto el botón change */
    z-index: 1;
    max-width: 50%;
}

.adhoc-card-header-campaign-label {
    opacity: 0.85;
}

.adhoc-card-header-campaign-marca {
    color: white;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Botón cambiar — visible solo si tiene >1 campaña */
.adhoc-card-header-change {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.34);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
    pointer-events: auto;  /* habilita click sobre el span no-clickable */
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.adhoc-card-header-change:hover {
    background: rgba(255, 255, 255, 0.30);
    border-color: rgba(255, 255, 255, 0.60);
    transform: translateY(1px);
}

.adhoc-card-header-change:active {
    transform: translateY(1px) scale(0.92);
}

.adhoc-card-header-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
}

.adhoc-card-header-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.adhoc-range-empty,
.adhoc-range-step {
    font-style: italic;
    color: rgba(255, 255, 255, 0.82);
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11.5px;
}

.adhoc-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* =====================================================
   Calendario — contenedor compacto
   ===================================================== */
.adhoc-cal-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.adhoc-cal-year-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 18px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    gap: 14px;
}

.adhoc-cal-year-group {
    display: flex;
    align-items: center;
    gap: 14px;
    grid-column: 2;
    justify-self: center;
}

/* Badges Semanal / Quincenal / Mensual — columna izquierda del year-nav */
.adhoc-cal-modo-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    grid-column: 1;
    justify-self: start;
    padding: 3px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 22px;
}

.adhoc-cal-modo-badge {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.adhoc-cal-modo-badge:hover:not(.active) {
    color: var(--adhoc-primary);
    background: rgba(112, 173, 71, 0.10);
}

.adhoc-cal-modo-badge.active {
    color: white;
    background: var(--adhoc-gradient);
    box-shadow: 0 2px 8px rgba(112, 173, 71, 0.35);
}

.adhoc-cal-year-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.adhoc-cal-year-btn:hover:not(:disabled) {
    border-color: var(--adhoc-primary);
    color: var(--adhoc-primary);
    background: rgba(112, 173, 71, 0.10);
}

.adhoc-cal-year-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.adhoc-cal-year {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 50px;
    text-align: center;
    letter-spacing: 0.4px;
}

.adhoc-cal-legend {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-size: 11.5px;
    color: var(--text-secondary);
    grid-column: 3;
    justify-self: end;
}

.adhoc-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.adhoc-cal-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.adhoc-cal-legend-dot.sel { background: var(--adhoc-gradient); box-shadow: 0 0 6px rgba(112, 173, 71, 0.4); }

.adhoc-cal-clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.adhoc-cal-clear:hover {
    color: var(--adhoc-primary);
    border-color: var(--adhoc-primary);
}

/* ----- Body: 12 meses en UNA sola fila horizontal.
       Nativo oculto — usamos scrollbar custom abajo para que el gradient se vea real. */
.adhoc-cal-body {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

.adhoc-cal-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* =====================================================
   Scrollbar CUSTOM con gradient verde→teal
   ===================================================== */
.adhoc-scrollbar-wrap {
    padding: 4px 14px 10px;
}

.adhoc-scrollbar-track {
    position: relative;
    height: 12px;
    background: linear-gradient(90deg, rgba(112, 173, 71, 0.28) 0%, rgba(27, 154, 170, 0.28) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
}

.light-mode .adhoc-scrollbar-track {
    background: linear-gradient(90deg, rgba(112, 173, 71, 0.18) 0%, rgba(27, 154, 170, 0.18) 100%);
}

.adhoc-scrollbar-thumb {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 20%;
    background: linear-gradient(90deg, #70AD47 0%, #1B9AAA 100%);
    border-radius: 10px;
    box-shadow:
        0 0 10px rgba(112, 173, 71, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
    cursor: grab;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
    will-change: left, width;
}

.adhoc-scrollbar-thumb:hover {
    filter: brightness(1.10) saturate(1.1);
    box-shadow:
        0 0 14px rgba(112, 173, 71, 0.50),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.adhoc-scrollbar-thumb:active {
    cursor: grabbing;
}

.adhoc-cal-months {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 100%;
    box-sizing: border-box;
}

.adhoc-cal-month {
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 330px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.adhoc-cal-month:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(112, 173, 71, 0.14);
    border-color: rgba(112, 173, 71, 0.3);
}

.adhoc-cal-month-hd {
    background: var(--adhoc-gradient);
    padding: 7px 8px;
    text-align: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    flex-shrink: 0;
}

/* Semanas EN FILA horizontal dentro del mes */
.adhoc-cal-month-bd {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    align-items: stretch;
    justify-content: center;
}

/* Quincenal: cards más angostos, chips con tope razonable */
.adhoc-cal-month-quincenal {
    min-width: 200px;
}

.adhoc-cal-month-quincenal .adhoc-cal-w {
    max-width: 110px;
}

/* Mensual: un solo chip → card compacto, ~12 meses caben sin scroll horizontal en pantallas medianas */
.adhoc-cal-month-mensual {
    min-width: 130px;
}

.adhoc-cal-month-mensual .adhoc-cal-w {
    flex: 0 0 auto;
    min-width: 90px;
    max-width: 140px;
    padding: 9px 14px;
}

.adhoc-cal-w {
    flex: 1;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    padding: 7px 7px 11px 7px;  /* extra bottom para dejarle aire al indicador */
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    user-select: none;
    white-space: nowrap;
    position: relative;  /* para el dot ::after */
}

/* Indicador "tiene datos" — dot debajo del texto del periodo.
   Independiente del modo (Semanal/Quincenal/Mensual): se pinta si cualquier
   día del rango del periodo tiene al menos un detalle en la campaña. */
.adhoc-cal-w.has-data::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--adhoc-primary);
    box-shadow: 0 0 5px rgba(112, 173, 71, 0.75);
}

/* Cuando el periodo está seleccionado, el fondo es gradient verde-teal.
   Un dot verde se perdería: lo cambiamos a blanco con glow blanco. */
.adhoc-cal-w.has-data.sel::after {
    background: #ffffff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.85);
}

/* Hover: solo realza el borde + sombra, texto y fondo sin cambios para mantener legibilidad */
.adhoc-cal-w:hover:not(.sel) {
    border-color: var(--adhoc-primary);
    box-shadow: 0 2px 10px rgba(112, 173, 71, 0.22);
    transform: translateY(-1px);
}

/* Rango completo: TODAS las semanas seleccionadas con gradient sólido y texto blanco */
.adhoc-cal-w.sel {
    background: var(--adhoc-gradient);
    color: #ffffff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(112, 173, 71, 0.35);
}

.adhoc-cal-w.sel:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* =====================================================
   Header derecho: contador + acciones (export)
   ===================================================== */
.adhoc-card-header-right {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.adhoc-card-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =====================================================
   Botones de exportación (ghost pills sobre header gradient)
   ===================================================== */
.adhoc-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: white;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 18px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.adhoc-btn-export > svg {
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.adhoc-btn-export:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.96);
    border-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20);
}

.adhoc-btn-export:active:not(:disabled) {
    transform: translateY(0);
}

.adhoc-btn-export:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    backdrop-filter: none;
}

/* Excel → verde Office 365 (hover) */
.adhoc-btn-excel:hover:not(:disabled) {
    color: #0F7B3F;
}
.adhoc-btn-excel:hover:not(:disabled) > svg {
    color: #0F7B3F;
}

/* PowerPoint → naranja Office 365 (hover) */
.adhoc-btn-pptx:hover:not(:disabled) {
    color: #B7472A;
}
.adhoc-btn-pptx:hover:not(:disabled) > svg {
    color: #B7472A;
}

/* Mapa → verde brand (hover) */
.adhoc-btn-mapa:hover:not(:disabled) {
    color: var(--adhoc-primary);
}
.adhoc-btn-mapa:hover:not(:disabled) > svg {
    color: var(--adhoc-primary);
}

/* =====================================================
   Botón primario (Cargar imágenes)
   ===================================================== */
.adhoc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: white;
    background: var(--adhoc-gradient);
    border: none;
    border-radius: 22px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(112, 173, 71, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
}

.adhoc-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08) saturate(1.05);
    box-shadow: 0 5px 16px rgba(112, 173, 71, 0.50);
}

.adhoc-btn-primary:active:not(:disabled) { transform: translateY(0); }

.adhoc-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.adhoc-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    animation: adhocSpin 0.7s linear infinite;
}

@keyframes adhocSpin { to { transform: rotate(360deg); } }

/* =====================================================
   Galería de sitios (card-grow)
   ===================================================== */
.adhoc-img-body {
    flex: 1;
    min-height: 0;
    padding: 16px;
}

.adhoc-img-grid-wrap {
    width: 100%;
}

.adhoc-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

/* =====================================================
   Card individual de sitio
   ===================================================== */
.adhoc-sitio-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    will-change: transform;
}

/* Estado activo del card — UNA SOLA fuente de verdad controlada desde C#:
   _hoveredSitioId ?? _selectedSitioId. No usamos :hover de CSS porque
   queremos que hover y tap se vean idénticos, y porque dejar :hover paralelo
   crearía "dos cards activos" cuando hay uno fijado por tap y haces hover en
   otro. Aquí solo aplica .is-active al card que C# considera el activo. */
.adhoc-sitio-card {
    cursor: pointer;
}

.adhoc-sitio-card.is-active {
    transform: translateY(-4px);
    border-color: var(--adhoc-primary);
    box-shadow: 0 0 0 2px var(--adhoc-primary),
                0 14px 32px rgba(112, 173, 71, 0.45);
}

.adhoc-sitio-card.is-active .adhoc-sitio-img-wrap img {
    transform: scale(1.06);
}

.adhoc-sitio-img-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.adhoc-sitio-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* Overlay con gradient del brand en la parte baja de la imagen */
.adhoc-sitio-img-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

/* Badge de advertencia (ámbar) sobre la imagen del sitio */
.adhoc-sitio-warning {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 4px 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #1f1300;
    background: #FFFF00;
    border: 1px solid #CA8A04;
    border-radius: 20px;
    box-shadow: 0 0 14px rgba(255, 255, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.adhoc-sitio-meta {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.adhoc-sitio-row-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.adhoc-sitio-row-top .adhoc-sitio-marca {
    flex: 1;
    min-width: 0;
}

.adhoc-sitio-row-top .adhoc-sitio-fecha {
    flex-shrink: 0;
}

.adhoc-sitio-marca {
    font-size: 14.5px;
    font-weight: 800;
    background: var(--adhoc-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.adhoc-sitio-dir {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.adhoc-sitio-dir > svg {
    flex-shrink: 0;
    color: var(--adhoc-primary);
    margin-top: 2px;
}

.adhoc-sitio-ciudad {
    font-size: 11.5px;
    color: var(--text-primary);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.adhoc-sitio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
    font-size: 10.5px;
    line-height: 1.3;
}

.adhoc-sitio-tipo {
    font-weight: 700;
    color: var(--adhoc-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.adhoc-sitio-fecha {
    color: var(--text-secondary);
    font-size: 10.5px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.adhoc-sitio-prov {
    color: var(--text-secondary);
    font-size: 10.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    text-align: right;
}

/* =====================================================
   Empty state (sin imágenes cargadas)
   ===================================================== */
.adhoc-empty {
    flex: 1;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 40px 24px;
}

.adhoc-empty-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--adhoc-gradient);
    color: #ffffff;
    box-shadow: 0 6px 24px rgba(112, 173, 71, 0.15);
    border: 1px solid rgba(112, 173, 71, 0.25);
}

.adhoc-empty-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.adhoc-empty-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 440px;
    line-height: 1.6;
}

/* =====================================================
   Modal de exportación
   ===================================================== */
.adhoc-export-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: adhocExportFadeIn 0.25s ease;
}

.light-mode .adhoc-export-overlay {
    background: rgba(15, 24, 18, 0.45);
}

.adhoc-export-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 36px 24px;
    width: 460px;
    max-width: 92vw;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(112, 173, 71, 0.10);
    animation: adhocExportModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.adhoc-export-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--adhoc-gradient);
    border-radius: 16px 16px 0 0;
}

.adhoc-export-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(112, 173, 71, 0.10);
    border: 1px solid rgba(112, 173, 71, 0.25);
}

.adhoc-export-icon svg {
    width: 26px;
    height: 26px;
    color: var(--adhoc-primary);
}

.adhoc-export-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.adhoc-export-subtitle {
    font-size: 13.5px;
    font-weight: 500;
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.adhoc-export-spinner-wrap {
    display: flex;
    justify-content: center;
    margin: 14px 0 12px;
}

.adhoc-export-spinner-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #70AD47, #B8D84A, #1B9AAA, #70AD47);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    animation: adhocExportSpin 0.8s linear infinite;
    filter: drop-shadow(0 0 8px rgba(112, 173, 71, 0.3));
}

.adhoc-export-msg {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 14px;
    min-height: 18px;
}

.adhoc-export-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.30);
    animation: adhocExportSuccessPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.adhoc-export-success-icon svg {
    width: 28px;
    height: 28px;
    color: #22c55e;
}

.adhoc-export-success-icon.is-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.30);
}

.adhoc-export-success-icon.is-error svg {
    color: #ef4444;
}

.adhoc-export-done-msg {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 18px;
    line-height: 1.5;
}

.adhoc-export-close {
    padding: 8px 28px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.adhoc-export-close:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--adhoc-primary);
}

@keyframes adhocExportFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes adhocExportModalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes adhocExportSpin {
    to { transform: rotate(360deg); }
}

@keyframes adhocExportSuccessPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* =====================================================
   Modal de exportación PPT — botones por lote
   ===================================================== */
.adhoc-pptx-batches {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 6px 0 16px;
    width: 100%;
}

.adhoc-pptx-batch-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    width: 100%;
    text-align: left;
    overflow: hidden;
}

.adhoc-pptx-batch-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--adhoc-gradient);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.adhoc-pptx-batch-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.adhoc-pptx-batch-btn:hover:not(:disabled) {
    border-color: var(--adhoc-primary);
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
}

.adhoc-pptx-batch-btn:disabled {
    cursor: default;
}

.adhoc-pptx-batch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.adhoc-pptx-batch-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(112, 173, 71, 0.10);
    border: 1px solid rgba(112, 173, 71, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--adhoc-primary);
    flex-shrink: 0;
}

.adhoc-pptx-batch-icon svg {
    width: 16px;
    height: 16px;
}

.adhoc-pptx-batch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.adhoc-pptx-batch-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.adhoc-pptx-batch-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.adhoc-pptx-batch-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.adhoc-pptx-batch-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #70AD47, #B8D84A, #1B9AAA, #70AD47);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
    animation: adhocExportSpin 0.8s linear infinite;
    flex-shrink: 0;
}

.adhoc-pptx-batch-btn.is-generating {
    border-color: var(--adhoc-primary);
    background: rgba(112, 173, 71, 0.06);
    cursor: progress;
}

.adhoc-pptx-batch-btn.is-generating::before { opacity: 1; }

.adhoc-pptx-batch-btn.is-done {
    border-color: rgba(34, 197, 94, 0.40);
    background: rgba(34, 197, 94, 0.06);
    cursor: default;
}

.adhoc-pptx-batch-btn.is-done .adhoc-pptx-batch-icon {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.30);
    color: #22c55e;
}

.adhoc-pptx-batch-btn.is-done .adhoc-pptx-batch-status {
    color: #22c55e;
}

.adhoc-pptx-batch-btn.is-error {
    border-color: rgba(239, 68, 68, 0.40);
    background: rgba(239, 68, 68, 0.06);
}

.adhoc-pptx-batch-btn.is-error .adhoc-pptx-batch-status {
    color: #ef4444;
}

.adhoc-pptx-summary {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.adhoc-pptx-summary strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1100px) {
    .adhoc-cal-year-nav { grid-template-columns: 1fr; row-gap: 10px; }
    .adhoc-cal-modo-group,
    .adhoc-cal-year-group,
    .adhoc-cal-legend { grid-column: 1; justify-self: center; }
    .adhoc-cal-legend { flex-wrap: wrap; justify-content: center; }
    .adhoc-cal-month { min-width: 190px; }
}

@media (max-width: 900px) {
    .adhoc-topbar-greeting { font-size: 15px; gap: 10px; }
    .adhoc-topbar-client-logo { max-height: 26px; }
    .adhoc-topbar-client-pill { padding: 3px 8px; border-radius: 7px; }

    /* En el header del calendario: si no hay espacio en una sola fila,
       movemos la campaña al flujo normal y la centramos en su propia línea */
    .adhoc-card-header-with-summary {
        flex-direction: column;
        align-items: flex-start;
    }
    .adhoc-card-header-campaign {
        position: static;
        transform: none;
        align-self: center;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .adhoc-main { padding: 10px; }
    .adhoc-topbar { padding: 0 14px; }
    .adhoc-topbar-logo { height: 24px; }
    .adhoc-topbar-greeting { font-size: 13px; gap: 8px; }
    .adhoc-topbar-client-logo { max-height: 22px; }
    .adhoc-topbar-client-pill { padding: 2px 6px; border-radius: 6px; }
    .adhoc-card-header-campaign { font-size: 10.5px; gap: 6px; }
    .adhoc-card-header-campaign-marca { font-size: 12.5px; }
    .adhoc-cal-month { min-width: 180px; }
    .adhoc-cal-w { font-size: 10.5px; padding: 7px 8px; min-width: 44px; }
    .adhoc-cal-legend { flex-wrap: wrap; justify-content: center; }
    .adhoc-cal-modo-badge { padding: 5px 10px; font-size: 10.5px; }
    .adhoc-img-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
    .adhoc-sitio-marca { font-size: 13.5px; }
    .adhoc-back-to-top { width: 44px; height: 44px; bottom: 18px; right: 22px; }
    .adhoc-back-to-top svg { width: 19px; height: 19px; }

    /* En pantallas chicas: row pasa a columna, mapa abajo del stack */
    .adhoc-main-row {
        flex-direction: column;
    }
    .adhoc-main-row.has-mapa-open .adhoc-mapa-panel {
        flex-basis: 70vh;
    }
}

/* =====================================================
   Toggle "Mapa" (en header de Card 2)
   ===================================================== */
.adhoc-btn-mapa.is-active {
    background: white;
    border-color: white;
    color: var(--adhoc-primary);
}

.adhoc-btn-mapa.is-active > svg {
    color: var(--adhoc-primary);
}

.adhoc-btn-mapa-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    margin-left: 4px;
    font-size: 9.5px;
    font-weight: 800;
    color: #1f1300;
    background: #FFC400;
    border-radius: 10px;
    line-height: 1;
}

/* =====================================================
   Panel del mapa — sticky card hermano
   ===================================================== */
/* Panel del mapa: card hermano del stack izquierdo dentro de .adhoc-main-row.
   `align-self: flex-start` para que NO se estire al height del row (el row
   tiene align-items: stretch para el stack). En su lugar, height fija =
   viewport - topbar - paddings, top-aligned con el calendario.
   Sticky nativo — ningún ancestro entre el panel y .adhoc-main tiene
   overflow:hidden, así que el scroll-container es el main y el panel se
   queda pegado al viewport mientras el stack sigue scrolleando.
   Cerrado = flex-basis 0 (stack ocupa todo). Abierto = 42%. */
.adhoc-mapa-panel {
    position: sticky;
    top: 0;                    /* el padding 16px de .adhoc-main da el gap del topbar */
    align-self: flex-start;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 0;
    overflow: hidden;
    height: calc(100vh - var(--topbar-height) - 32px);
    min-height: 360px;
    opacity: 0;
    pointer-events: none;
    transition: flex-basis 320ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 240ms ease;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.30);
}

.adhoc-main-row.has-mapa-open .adhoc-mapa-panel {
    flex-basis: calc(42% - 8px);
    opacity: 1;
    pointer-events: auto;
}

.adhoc-mapa-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--adhoc-gradient);
    color: white;
    border-radius: 11px 11px 0 0;
    flex-shrink: 0;
}

.adhoc-mapa-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.adhoc-mapa-summary {
    flex: 1;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adhoc-mapa-warn {
    color: #FFE082;
    font-weight: 600;
}

.adhoc-mapa-close {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
    flex-shrink: 0;
}

.adhoc-mapa-close:hover {
    background: rgba(255, 255, 255, 0.34);
    transform: rotate(90deg);
}

.adhoc-mapa-canvas {
    flex: 1;
    min-height: 0;
    width: 100%;
    border-radius: 0 0 11px 11px;
    overflow: hidden;
    background: var(--bg-secondary);
}

/* Override del bg #ddd default de Leaflet — leaflet.css carga DESPUÉS
   de monitoreo.css así que su .leaflet-container ganaba el cascade y
   las áreas sin tiles se veían gris claro fuera de tema. */
.adhoc-mapa-canvas.leaflet-container,
.adhoc-mapa-canvas .leaflet-container {
    background: var(--bg-secondary);
}

.light-mode .adhoc-mapa-canvas.leaflet-container,
.light-mode .adhoc-mapa-canvas .leaflet-container {
    background: var(--bg-card);
}

/* Limpia el outline azul de Leaflet en focus */
.adhoc-mapa-canvas:focus,
.adhoc-mapa-canvas *:focus { outline: none; }

/* Controles de zoom acordes al tema */
.adhoc-mapa-canvas .leaflet-control-zoom a {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.adhoc-mapa-canvas .leaflet-control-zoom a:hover {
    background: var(--bg-glass-hover);
    color: var(--adhoc-primary);
}

/* =====================================================
   Markers del mapa (DOM con glow + ring pulse)
   ===================================================== */
@keyframes mpAdhocMarkerPulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    50%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(1);   opacity: 0; }
}

@keyframes mpAdhocMarkerGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 255, 255, 0.2); }
    50%      { box-shadow: 0 0 14px rgba(255, 255, 255, 0.4); }
}

.custom-marker-adhoc {
    background: transparent !important;
    border: none !important;
}

.mp-adhoc-marker {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.mp-adhoc-marker:hover {
    transform: scale(1.5) !important;
    z-index: 1000 !important;
}

.mp-adhoc-marker-dot {
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
}

.mp-adhoc-marker-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid;
    animation: mpAdhocMarkerPulse 2.5s ease-out infinite;
    pointer-events: none;
}

/* Marker resaltado (hover desde card → cyan) */
.custom-marker-adhoc.is-active .mp-adhoc-marker {
    transform: scale(1.7);
    background: radial-gradient(circle at 35% 35%, #00b4ff, #0080cc) !important;
    box-shadow: 0 0 0 4px rgba(0, 180, 255, 0.35),
                0 0 18px rgba(0, 180, 255, 0.7),
                0 2px 6px rgba(0, 0, 0, 0.4) !important;
    z-index: 1000 !important;
}

.custom-marker-adhoc.is-active .mp-adhoc-marker-ring {
    border-color: rgba(0, 180, 255, 0.7) !important;
}

/* ========== Marker de "punto base" (estadios u otro POI por campaña) ========== */
.custom-marker-base {
    background: transparent !important;
    border: none !important;
}

.mp-adhoc-base {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    white-space: nowrap;
}

.mp-adhoc-base-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00b4ff;
    flex-shrink: 0;
}

.mp-adhoc-base-label {
    background: #00b4ff;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 3px 9px;
    border-radius: 999px;
}
