/**
 * OM Portal — PATRÓN ÚNICO DE FILTROS (.omflt-*) — aprobado 16-jul.
 *
 * FUENTE ÚNICA del formato de filtros de todas las pestañas del portal.
 * Reglas del patrón:
 *   - Barra bajo el título/tabs: búsqueda PRIMERO (lupa dentro, flexible,
 *     max 420px) → selects de acotación → extras → "✕ Limpiar" (solo con
 *     filtros activos). Conteo "Mostrando N…" debajo (.omflt-conteo).
 *   - Controles de 36px, borde suave, radio 7px, hover/focus índigo.
 *   - Selects SIN labels arriba: la 1ª opción es autodescriptiva.
 *   - Comportamiento: instantáneo por default; SOLO periodo (año/mes)
 *     recarga — mismo control visual, la recarga es transparente.
 *   - Variantes: .omflt-toggle (binarios tipo CxC/CxP o moneda),
 *     .omflt-chip (multi-toggle con dot, Agenda). Los chips-contadores
 *     (pulso) son EXCLUSIVOS de dashboards/colas y viven en su módulo.
 *   - Responsive <680px: búsqueda a lo ancho, selects en 2 columnas.
 *
 * Tokens índigo con fallback literal: tokens.css no se enfila en todas
 * las páginas del portal, la barra no puede depender de él.
 */

.omflt {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* --- Búsqueda (siempre primero) --- */
.omflt-search {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}
.omflt-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    width: 14px;
    height: 14px;
}
.omflt-search input {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    padding: 0 12px 0 32px;
    font-size: 13px;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    font-family: inherit;
    background: #fff;
    color: #18181b;
}
.omflt-search input::placeholder { color: #9ca3af; }

/* --- Selects uniformes --- */
.omflt-select {
    height: 36px;
    box-sizing: border-box;
    padding: 0 28px 0 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    font-family: inherit;
    background-color: #fff;
    color: #18181b;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%2371717a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.omflt-select:hover { border-color: var(--om-primary, #29108F); }
.omflt-search input:focus,
.omflt-select:focus {
    outline: none;
    border-color: var(--om-primary, #29108F);
    box-shadow: 0 0 0 3px rgba(41, 16, 143, 0.12);
}

/* Inputs de fecha compactos (rango en Gastos/Mis cuentas) */
.omflt-date {
    height: 36px;
    box-sizing: border-box;
    padding: 0 10px;
    font-size: 13px;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    font-family: inherit;
    background: #fff;
    color: #18181b;
}
.omflt-date:focus {
    outline: none;
    border-color: var(--om-primary, #29108F);
    box-shadow: 0 0 0 3px rgba(41, 16, 143, 0.12);
}
.omflt-date-sep { font-size: 12px; color: #9ca3af; }

/* Grupo de controles que se muestran/ocultan juntos (p.ej. mes+año vs
   fechas custom en Mis cuentas). [hidden] debe ganar al display propio. */
.omflt-group { display: inline-flex; gap: 8px; align-items: center; }
.omflt-group[hidden] { display: none; }

/* --- Extras --- */
.omflt-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #52525b;
    cursor: pointer;
    white-space: nowrap;
}
.omflt-check input { accent-color: var(--om-primary, #29108F); }

/* --- Limpiar (solo visible con filtros activos) --- */
.omflt-limpiar {
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--om-primary, #29108F);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: none;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.omflt-limpiar.is-visible { display: inline-flex; }
.omflt-limpiar:hover { text-decoration: underline; }

/* --- Conteo bajo la barra --- */
.omflt-conteo {
    font-size: 12px;
    color: #71717a;
    margin: 0 0 10px;
}

/* --- Variante: toggle segmentado (binarios) --- */
.omflt-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.omflt-toggle a,
.omflt-toggle button {
    height: 30px;
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #71717a;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.omflt-toggle a.is-active,
.omflt-toggle button.is-active {
    background: var(--om-primary, #29108F);
    color: #fff;
}

/* --- Variante: chips-leyenda multi-toggle (Agenda) --- */
.omflt-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.omflt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
    background: #fff;
    color: #71717a;
    cursor: pointer;
    font-family: inherit;
}
.omflt-chip .omflt-chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.omflt-chip.is-on {
    border-color: var(--om-primary, #29108F);
    color: #18181b;
    background: var(--om-primary-light, #F1EDFB);
}

/* --- Responsive único --- */
@media (max-width: 680px) {
    .omflt-search { flex: 1 1 100%; max-width: none; }
    .omflt-select { flex: 1 1 45%; }
    .omflt-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}
